Stopping Code and Returning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know this is simple, but believe it or not I have never needed to do this
before...

In running a series of code, I need to open another form for a response.
While the second form is open, I need the code to pause and wait until the
second form has finished processing.

I changed the code from a Sub to a Function, but it causes the entire
primary form to have problems.

Is there another way to pause the code, on the first form, until the second
form is closed?

Thanks, in advance.

Sharkbyte
 
Hello Sharkbyte.

Sharkbyte said:
I know this is simple, but believe it or not I have never needed to
do this before...

In running a series of code, I need to open another form for a
response. While the second form is open, I need the code to pause
and wait until the second form has finished processing.

I changed the code from a Sub to a Function, but it causes the
entire primary form to have problems.

Is there another way to pause the code, on the first form, until the
second form is closed?

You could open the second form using acDialog for the WindowMode
parameter of DoCmd.OpenForm. This will pause the code until the
second form is either closed or hidden.
 
Is there another way to pause the code, on the first form, until the second
form is closed?

Yes. Open the form in Dialog mode:

DoCmd.OpenForm "frmMyForm", WindowMode := acDialog

The calling routine's code will pause until the opened form is either
closed or (as is sometimes very handy) until its Visible property is
set to False.


John W. Vinson[MVP]
 

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

Similar Threads


Back
Top