Question about modal userform.....

  • Thread starter Thread starter Robert Crandal
  • Start date Start date
R

Robert Crandal

My userform has various controls which allow the user
to enter data. (i.e textboxes, calendar control, etc...).
I load the userform as follows:

Userform1.Show
'
' Code here runs after userform is closed!
'

My question is....will the Visual Basic stop and wait
at the "Userform1.Show" line until the user is done
entering data and they close it out??? I'm just
worried that the form is loaded and that VBA
continues exiting the code below the "userform1.show"
line.

thankx
 
No, you are okay, the code flow is passed to the code in the form, and the
parent procedure continues when the form is exited.

HTH

Bob
 
If the form is shown modal (e.g., UserForm1.Show vbModal), execution
will not resume after the Show method until the form has been hidden
or unloaded. Note that when a modal form is displayed, its code can
display other modal forms but not modeless forms.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]
 
Back
Top