Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms and VBA Execution Order 1

Status
Not open for further replies.

dftjsn

Programmer
Feb 25, 2002
43
US
On a main data entry form, I have a command button that users click when they are ready to create a data export file. The command button’s on-click event contains VBA code to examine each of the data fields. If there is a problem, the VBA code in this original on-click event of the main data entry form pops up a new form that contains a listbox with the viable entries and asks the user to select the correct one. Once the user selects the correct entry from the listbox, processing resumes in the VBA code of the original on-click event of the main data entry form. The problem I’m having is that when the new form pops up with the listbox, the VBA code in the original on-click event of the main data entry form continues executing rather than waiting for the user to make a selection in the listbox. I’m new to VBA in Access. Any help would be greatly appreciated.
 
Hi!

Try using this code to open the form with the listbox:

DoCmd.OpenForm "YourForm", , , , , acDialog

hth
Jeff Bridgham
bridgham@purdue.edu
 
You can also set its property "Modal" to true. This way, the dialog form must be closed for the code to continue... To boldly code, where no programmer has compiled before!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top