Parameter Query with Dropdown Box

G

Guest

I would like to set up a parameter query which asks the user to select a code
from a choice of 60+. How do I set up this query so that it provides a
dropdown box for the user toselect the correct code rather than having to
type it in? I do have a table with these codes in.
 
F

fredg

I would like to set up a parameter query which asks the user to select a code
from a choice of 60+. How do I set up this query so that it provides a
dropdown box for the user toselect the correct code rather than having to
type it in? I do have a table with these codes in.

Is the query the end result or is the query to be used as the record
source for a report?

The following is if the query is the end result.

You cannot use a combo box in a query prompt.
You'll need to use a form to do this.

Make a new unbound form or use an existing form.
Add a combo box that will show the CodeID field.
Make sure the Combo Box Bound Column is the
same DataType as the CodeID field.
Add a command button.
Code the button's Click event:
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Name this form "ParamForm"

Code the Query CodeID field's criteria line
forms!ParamForm!ComboBoxName

Open the form.
Find the CodeID in the combo box.
Click the command button.

The query will display just those records selected.
The Form will close.
 
O

OfficeDev18 via AccessMonster.com

Don't do it in the query directly. Make a form, and use the wizard to create
a combo box on the form. In the wizard, chose the "Table/Query" option, and
have Access read the table directly.

There's obviously more going on, but I'm addressing your question.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top