Behind my user form I have a UserForm_QueryClose macro. This as I would
like people to confirm when they press the Escape key. I want them to
realize they will be closing the form and not saving any changes to their
input data. If I set the Cancel property on my cancel button to False, then
the escape key is not allowed. If I set it to True, escape works, the
UserForm_QueryClose macro is called, but I can't tell that an escape was
pressed instead of the Cancel button being clicked.
What I observe is when escape is pressed, or the done or cancel buttons are
clicked (all are doing unloads), inside the macro Cancel=0 and CloseMode=1.
If the X in the upper right of the form is clicked, Cancel=0 and
CloseMode=0. Is there any other more useful information that can be
accessed so I can do what I want? I suspect not. (When does Cancel=1?)
Don <www.donwiss.com> (e-mail link at home page bottom).
Bookmarks