How to create Dropdown in a Query?

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

I would like to actually have a drop down box appear when a query is ran so
client can select criteria..I generally have using a parameter query, but,
would like to have client choose critera to run query.....'There will only
be one selection...Im using Access 2000...Thanks Bill
 
Dear Bill:

You cannot have a query "create a drop down box" to do this, but you
can put a combo box on a form and have the query respect that.

To reference a control from a query, use the format:

[Forms]![FormName]![ControlName]

The form FormName MUST be open when the query is run, and the control
ControlName must exits. The value of this control will be used at
that point in the query.

The above applies to MDBs and not to ADPs.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
I would like to actually have a drop down box appear when a query is ran so
client can select criteria..I generally have using a parameter query, but,
would like to have client choose critera to run query.....'There will only
be one selection...Im using Access 2000...Thanks Bill

The way to do this is to create a little unbound form, frmCrit, with a
combo box cboCriterion on it. Use a Parameter Query with

=[Forms]![frmCrit]!cboCriterion

as the criterion. The user should open frmCrit, select the value from
the combo (or enter any other needed criteria, if there are more than
one); it's convenient to put a command button on frmCrit to open a
Form based on the query for onscreen viewing, or a Report for
printing. I prefer never to display query datasheets to users, but the
button can do that too if you wish.
 
Back
Top