By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Query Parameter drop down box???

P: n/a
Hi,

I was wondering if it is possible (Using access) to have a query parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down box?
And whether it is possible?

Kind regards,

Cassandra
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
no bother at all !!

With your form in design view make sure the wizard is turned on and select combo
box from the tool bar.
The wizard will guide you through the set up
In your query criteria put something like --
[Forms]![yourformname]![yourcomboname]

The query will look at the first column in the combo some make sure that is
doing what you want

HTH
David B

cassandra.flowers <ca***************@btopenworld.com> wrote in message
news:c5**********@sparta.btinternet.com...
Hi,

I was wondering if it is possible (Using access) to have a query parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down box?
And whether it is possible?

Kind regards,

Cassandra


Nov 12 '05 #2

P: n/a
You have to design a form to ask for the parameter and then set the
criteria to the value of combo box on the form.

If the form is called myform and the combo box mycombo then the criteria
(for equality) is:

Forms!myform!mycombo

You use a button on the form to run the query.

Peter Russell

cassandra.flowers previously wrote:
I was wondering if it is possible (Using access) to have a query
parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down
box?
And whether it is possible?


Nov 12 '05 #3

P: n/a
Hi Cassandra,

Not that there is anything at all wrong with the suggestions made by David
and Peter, but I am in the habit now of taking this one step further...

The problems (annoyances, really) with this form / query method are:
1.) It is possible to open the query without having the form open, which
causes a message to be displayed prompting for the form reference parameter.
2.) Assuming that I now have the form open, have specified a parameter, and
have received the desired results in the query. Now I want to specify a
different parameter and see the new results. I have to close the query,
return to the form, specify something else, then re-open the query.

I recall thinking "There's just gotta be a better way!" ... and there is.

What I do now is to use an unbound main form that collects the criteria, and
have the results immediately displayed in a datasheet-style subform on the
same form!
I build an SQL string (the same thing that using a "query" does) using code,
then use that SQL as the recordsource for the subform. Changing the
subform's recorsource forces a requery of the subform, so the results are
nearly instantaneously displayed.

You can also (optionally) open a report based on the same SQL string in
order to get a "hard copy" of the same data that is displayed in the
subform. I call this the "WYSIWYG" (What You See Is What You Get) approach
to reporting.

If you're interested in this method, have a look at one of my recent posts
on this.
http://groups.google.ca/groups?q=Don...lgrps13&rnum=3

Don

"cassandra.flowers" <ca***************@btopenworld.com> wrote in message
news:c5**********@sparta.btinternet.com...
Hi,

I was wondering if it is possible (Using access) to have a query parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down box? And whether it is possible?

Kind regards,

Cassandra

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.