How to program Esc Key to exit form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could anybody help me to find out how to program Esc Key to exit an open form.

thanks for your help!
 
Escape Key has special functions (undo current entry then undo current
record) in Forms.

Do you really want to override these special functions?

If you do, set the Form's KeyPreview to True and then use the Form's
KeyPress (or KeyDown?) Event to check for the Escape Key and close the Form
accordingly. You may need to use the Undo Method to undo the current edits
on the Form.
 
Back
Top