Only the object that has the focus can receive a keyboard event. For keyboard events, a form has the focus only if it is active and no control on that form has the focus. This happens only on blank forms and forms on which all controls have been disabled. However, if you set the KeyPreview property on a form to True, the form receives all keyboard events for every control on the form before the control recognizes them. This is extremely useful when you want to perform the same action whenever a certain key is pressed, regardless of which control has the focus at the time.
The KeyDown and KeyUp events provide the lowest level of keyboard response. Use these events to detect a condition that the KeyPress event is unable to detect, for instance:
Private Sub Form_Load()
Form1.KeyPreview = True
Text1.Text = ""
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
cmdNext_Click
End Sub
Private Sub cmdNext_Click()
Text1.Text = "Success"
End Sub
I hope this helps