Set up a query to get criteria from a popup dialog (2 Viewers)

joshosu420ok

New member
Local time
Today, 19:59
Joined
May 13, 2002
Messages
9
How do I set up my query to get its criteria from a form or dialog box that pops up when I run the query.
 

llkhoutx

Registered User.
Local time
Today, 13:59
Joined
Feb 26, 2001
Messages
4,018
The criteria in your query is the contents of the dialog box. Use the expression builder to properly buiild the reference to the dialog box.
 

joshosu420ok

New member
Local time
Today, 19:59
Joined
May 13, 2002
Messages
9
What do I put in the criteria field to make the form popup when I run the query?
 

rich.barry

Registered User.
Local time
Today, 19:59
Joined
Aug 19, 2001
Messages
176
The dialog box should run the query, not vice versa.
Set up a form containing all your criteria entry boxes, combos etc, plus a run query command button.
The On_Click event code of the button should be :

DoCmd.OpenQuery "QueryName", acViewNormal
DoCmd.Close acForm, "DialogFormName"

While the form is open, open the query as well, then go into the Builder. Under Forms, Loaded Forms you will find all the controls on your Dialog Form, thus you can make the query get the values from the form when the query runs.
 

Users who are viewing this thread

Top Bottom