New to queries: parameter query with dropdown box?

J

JMF

I'm just getting started on queries and want to do something that I imagine
is simple to set up but haven't figured it out yet.

A simple parameter query, but whereby instead of just asking me to enter a
value, it provides a dropdown box with the allowed values of that field
where I choose from.

Can somebody point me in the right direction?

Thanks!

John
 
R

Rick B

Just do a search and read the previous posts on the topic. The short answer
is that you can't do this in a query. You have to build a parameter form
for the user with your drop-down, then you have to reference it in your
query.

Read the previous posts and you will find many many examples of how to do
this.
 
J

John Spencer

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


A brief quote from an 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
 
J

JMF

Perfect. Thanks to all.

(I'm not surprised to hear it had been treated comprehensively before)

John

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


A brief quote from an 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
JMF said:
I'm just getting started on queries and want to do something that I
imagine is simple to set up but haven't figured it out yet.

A simple parameter query, but whereby instead of just asking me to enter
a value, it provides a dropdown box with the allowed values of that field
where I choose from.

Can somebody point me in the right direction?

Thanks!

John
 

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