Drop down list search

G

Guest

I currently have a query which run from 3 parameters in order to select
fields which are based on three criteria.
However, some users do not know the list to choose from and therefore i
think it would be far easier if there was some form of drop down list box to
select the option they require.
Is there any way of doing a drop down parameter or would I need to create a
form with the drop downs and then link this? If so, how would I?
Many Thanks,
Matt
 
J

John Spencer

Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm

Or check out this from MS
http://office.microsoft.com/en-us/access/HA011730581033.aspx

A brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!

Quoting John Vinson

Keywords: Parameter Queries, cascading comboboxes

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
F

fredg

I currently have a query which run from 3 parameters in order to select
fields which are based on three criteria.
However, some users do not know the list to choose from and therefore i
think it would be far easier if there was some form of drop down list box to
select the option they require.
Is there any way of doing a drop down parameter or would I need to create a
form with the drop downs and then link this? If so, how would I?
Many Thanks,
Matt

If the query is the end result you can use this.
If however, the query is used as the record source for a report, the
procedure is a bit different. Post back.

You'll need to use a form to do this.

Make a new unbound form.
Add a combo box that will show the CircuitID field.
Make sure the Combo Box Bound Column is the same DataType as the
CircuitID 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 CircuitID field criteria line:

forms!ParamForm!ComboBoxName

When you wish to run the query, open the form first.
Find the CircuitID in the combo box.
Click the command button.

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

Change [CircuitID] to whatever the actual field name is.
 

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