Waiting a Form to Close before executing the next statement

  • Thread starter Thread starter Roshan Abbasi via AccessMonster.com
  • Start date 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.
 
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.
 
Back
Top