The "right" way to do it is to add a CANCEL button to the form, and set that button's Cancel property to TRUE. Then, pressing ESC will press the new Cancel button. You should have code beneath the button containing the line
Code:
DoCmd.Close acForm, Me.Name
This technique is also used for an OkeyDokey button; you can set the Default property of the OK button to True. Then, pressing ENTER will cause the OK button to be pressed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.