Try the previous suggestion first. If that doesn't work, set the form's KeyPreview property to True and trap the Enter key in either the form's KeyPress or KeyDown event:
Private Sub Form1_Keypress(KeyAscii as Integer)
Select Case KeyAscii
Case 13 ' Enter
KeyAscii = 0
Command1_Click
End Select
End Sub
Or, if no other typing or clicking on the form is required, then simply set the tab index for the control to zero (0). Neil Konitzer, President
Freisoft
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.