Add a command button to close the form.
Set the button's Cancel property to Yes.
It then responds to the Esc key.
BTW, if you are using the Close action/method in your button, you may end up
silently losing whatever record you are editing when you close the form.
Details: http://allenbrowne.com/bug-01.html