Enable ESC to canel UserForm
I recreated this just now, and it works just fine on my end on either
page of the multipage control.
As for selecting the control, you can select your UserForm and in the
drop down in the Properties pane, you will find all the controls on
your form.
theSquirrel
Jay wrote:
I'd like to enable the Escape key to cancel a userform. My form has a single
multipage control with two pages.
I have inserted a commandbutton with its Cancel property set to True and
have hidden the commandbutton by sending it behind the Multipage control.
Its Click event is:
Private Sub CommandButton1_Click()
Unload Me
Set frmInstructions = Nothing
End Sub
I encounter two problems with this: First, the Escape key unloads the form
only when the second page of the multipage is visible (I'd like Esc to cancel
the form at any point). Second, I can't select the button for editing after
it is hidden behind the multipage (need definitive selection method).
--
Thanks in Advance,
Jay
|