Something has to catch the keystroke. You could create a sub or function that takes an arguement of a key and evaluates it that way. For example:
Private Sub Form_KeyPress(KeyAscii As Integer)
If IsEscapeKey(KeyAscii) Then
MsgBox "escape key"
Else
MsgBox "not escape Key"
End If
End Sub
Public Function IsEscapeKey(MyKey As Integer) As Boolean
If MyKey = vbKeyEscape Then
IsEscapeKey = True
Else
IsEscapeKey = False
End If
End Function
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only