Stop VBA execution

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.
 
J

John Spencer (MVP)

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).
 
T

TC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top