Same Variable in Multiple Parameter Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that summarizes 5 parameter queries. The variable entered in
the first parameter query would be the same for all parameter queries. Is
there a way to set it up so the user can enter the variable once instead of
five times?
 
The best way to set this up is to use a form and a control on the form to hold
the value you want to use. Then, you can initiate the query from a button on
the form.

The way to reference the control's value would be

Criteria: FORMS![THE Form Name]![The Control Name]
 
Thank you, this worked as needed. I created a form with a list box,
referenced the list box in the four queries. Created a macro that ran the the
four queries and opened the summary (fifth) query, then put a command button
on the form that ran the macro.

Next, I'm going to work on the multi-choice aspect of the list box. That's
why I chose the list box over the combo box.

John Spencer (MVP) said:
The best way to set this up is to use a form and a control on the form to hold
the value you want to use. Then, you can initiate the query from a button on
the form.

The way to reference the control's value would be

Criteria: FORMS![THE Form Name]![The Control Name]


I have a query that summarizes 5 parameter queries. The variable entered in
the first parameter query would be the same for all parameter queries. Is
there a way to set it up so the user can enter the variable once instead of
five times?
 
Well, if your four queries are all referenced in the fifth query, then there is
really no reason to "run" them separately. The Summary query should
automatically call them.

If you plan to use a multi-choice list box, then you have a much more complex
problem. You cannot simply reference it as a parameter, but will have to step
through the choices and build your where string for each of the queries.

Start a new thread when you need help on this one.
Thank you, this worked as needed. I created a form with a list box,
referenced the list box in the four queries. Created a macro that ran the the
four queries and opened the summary (fifth) query, then put a command button
on the form that ran the macro.

Next, I'm going to work on the multi-choice aspect of the list box. That's
why I chose the list box over the combo box.

John Spencer (MVP) said:
The best way to set this up is to use a form and a control on the form to hold
the value you want to use. Then, you can initiate the query from a button on
the form.

The way to reference the control's value would be

Criteria: FORMS![THE Form Name]![The Control Name]


I have a query that summarizes 5 parameter queries. The variable entered in
the first parameter query would be the same for all parameter queries. Is
there a way to set it up so the user can enter the variable once instead of
five times?
 
Back
Top