Pause VB Code

D

Del LaBo

I have a database that is used to record, investigate, track cusotmer complaints. On the main form there is a button (called Submit) that is use to;
1) Creates a unqiue ID for the record.
2) Displays a dialog box informing the user the unique ID.
3) Asks the user if they want to create a folder for pictures, other docs
4) Save all data to the tables
5) Send email to select addresses.

What I want to do is add an option for the user that would ask them if they want to input RGA (Return Good Authorization) information.

The button would be updated as follows;
1) Creates a unqiue ID for the record.
2) Displays a dialog box informing the user the unique ID.
3) Asks the user if they want to enter RGA information
4) Asks the user if they want to create a folder for pictures, other docs
5) Save all data to the tables
6) Send email to select addresses.

When the user is asked if they want to enter RGA information if they select NO the code in the On Click event would continue to run through completion. If the user selects YES then the RGA form would open.

I have all this working but the code in the On Click Event continues to run, what I would like to do is if the RGA form opens I'd like to pause the Submit button code until the RGA form is closed.

Is there anyway to do this?
 
J

Jon Lewis

DoCmd.OpenForm "RGAFormName", , , , , acDialog

is the code you need to open your form from a procedure and then suspend any
further code in your procedure from executing until the RGA form is closed
or made invisible. Note that this is not the same as just opening a form
that has its modal property set to yes, you have to use the acDialog
WindowMode parameter of DoCmd.OpenForm.

BTW these old newsgroups are barely frequented these days as Microsoft has
dropped support of them. Better to use:
http://social.msdn.microsoft.com/Forums/office/en-US/home?forum=accessdev

HTH
 

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