I would like to disable the Escape Key globally, that means in forms and reports. I would like it to call the On Undo Event in case there was a change, otherwise it should not do anything. My experience is that if I hit the Escape key when the report closes, it interferes with the processes running.
I know that I can set in the KeyDown Event procedure the keycode = 0, but how can I stop the escape key in reports, and have a public function called whenever the escape key is pressed.
This is my code in a form what do I do in a report?
I know that I can set in the KeyDown Event procedure the keycode = 0, but how can I stop the escape key in reports, and have a public function called whenever the escape key is pressed.
This is my code in a form what do I do in a report?
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err_Form_KeyDown
If KeyCode = vbKeyEscape Then
KeyCode = 0
Call UndoRec_Click
End If
Exit_Form_KeyDown:
Exit Sub
Err_Form_KeyDown:
MsgBox Err.Description
Resume Exit_Form_KeyDown
End Sub