Stop VBA execution

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hello everyone,

Is it possible in VBA to stop executing VBA code and wait
until a form is closed to continue VBA execution? A
while loop takes too much resources.

Thanks.
 
I'm guessing that you want to open a form and pause the calling code. If that
is the case open the form in DIALOG windowmode

DoCmd.OpenForm "FormName",WindowMode:=acDialog

that will halt all processing in the calling code until the form is closed or
hidden (set its visible property to false).
 
A while loop is fine if you include a DoEvents within the loop.

Alternatively, make the called for a modal form, or call it wth the
appropriate OenForm parameter (acDialog?).

HTH,
TC
 
Back
Top