Can a combo box be used in a parameter query?

B

BruceP62

I am trying to build a parameter query that prompts for criteria each time it
is run. I have been able to do that. What I would like to do, but have not
been able to, is have one of the criteria dialog boxes have a combo box/drop
down select list. Is this possible to do in a query? Or am I dreaming?
Thanks
 
F

fredg

I am trying to build a parameter query that prompts for criteria each time it
is run. I have been able to do that. What I would like to do, but have not
been able to, is have one of the criteria dialog boxes have a combo box/drop
down select list. Is this possible to do in a query? Or am I dreaming?
Thanks

You'll need to create a form with the combo box on it (or add the
combo to an existing form).

Then change the query parameter to:

Forms!FormName!ComboName

The form must be open when the query is run.
Select the value in the combo box, then run the query.
If this is a stand alone query, add a command button to the form.
Code it's click event:
DoCmd.OpenQuery "QueryName"
Me.Visible = False

Remember to close the form after the query is closed.
This can be all done using code, but you haven't indicated what else
you are doing, so this is as far as I can go now.
 
Top