Add a button to the form, and code like so
Private cmdEsc_Click()
Unload Me
End Sub
and set the Cancel property of that button to True
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
"x taol" wrote in message
...
i want to close the userform if press the esc key.
Current, the userform have many controls.
in that case, even if any control has focus, i want to close the
userform when the esc key pressed.
*** Sent via Developersdex http://www.developersdex.com ***