A Abe Katz Oct 3, 2008 #1 Hello, How can I detect which key was pressed in Access 2003 Thanks in advance Abe
D Douglas J. Steele Oct 3, 2008 #2 Detect which key was pressed where? Most Form controls (text box, combo box, etc.) have a KeyPress event that you can use.
Detect which key was pressed where? Most Form controls (text box, combo box, etc.) have a KeyPress event that you can use.
A Abe Katz Oct 3, 2008 #3 Thanks Doug, I want to use it on a form. When the enter-key is pressed, I want to run an event.
D Douglas J. Steele Oct 3, 2008 #4 Set the form's KeyPreview property to True, and you can then use the form's KeyPress event. Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then MsgBox "You hit Enter" End If End Sub
Set the form's KeyPreview property to True, and you can then use the form's KeyPress event. Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then MsgBox "You hit Enter" End If End Sub