Waiting a Form to Close before executing the next statement

  • Thread starter Roshan Abbasi via AccessMonster.com
  • Start date
R

Roshan Abbasi via AccessMonster.com

I am trying to use a Modal Form inside a procedure for collecting some user-
specific information (say, Username/password, for example).

I expect it to function in a way that unless a user clicks 'OK' or 'Cancel'
button (that is unless that form gets closed), the execution should not pass
on to the statement next to the one which is calling that Modal form.

The Modal form appears as expected, but the statement(s) following the call
to this form are also executed without waiting for that form to close.

Suggestion for the logic to achieve the purpose is requested for anticipated
thanks.
 
W

Wolfgang Kais

Hello Roshan.

Roshan Abbasi wrote via AccessMonster.com:
I am trying to use a Modal Form inside a procedure for collecting some
user-specific information (say, Username/password, for example).

I expect it to function in a way that unless a user clicks 'OK' or
'Cancel' button (that is unless that form gets closed), the
execution should not pass on to the statement next to the one
which is calling that Modal form.
The Modal form appears as expected, but the statement(s) following
the call to this form are also executed without waiting for that form
to close.

Open the form via:
DoCmd.OpenForm FormName:="MyForm", WindowMode:=acDialog
This will stop execution until the form MyForm is either closed or hidden.
 

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