Ashfaque
Search Beautiful Girls from your town for night
- Local time
- Today, 18:57
- Joined
- Sep 6, 2004
- Messages
- 897
Hi, 
I want to assign ESC key to close the form. I know the below way keeping Key Preview = Yes in forms property and KeyDown even with below code.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF2
Docmd.OpenForm "fsdfdsfdsf"
End Select
End Sub
But I need to close the current form using ESC key only. How can it be done?
Please note my each form has set Pop Up and Modal =Yes.
Regards,
Ashfaque

I want to assign ESC key to close the form. I know the below way keeping Key Preview = Yes in forms property and KeyDown even with below code.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF2
Docmd.OpenForm "fsdfdsfdsf"
End Select
End Sub
But I need to close the current form using ESC key only. How can it be done?
Please note my each form has set Pop Up and Modal =Yes.
Regards,
Ashfaque