Access queries with dropdowns list for parameters?

E

Emily Bright

How can I make a query so that the criteria for the parameters are a drop
down list of the values in that field. For example, if the field is "Country
of Project", the user can choose from the available countries via a drop down
list rather than enter in "Kenya" in the criteria box. Also, is it possible
to let the user select more than one country (via using the Control botton
while selecting?) from this drop down list? I've been trying to figure this
out for days. ANY HELP would be greatly appreciated!! Thanks.
 
R

Rick Brandt

Emily said:
How can I make a query so that the criteria for the parameters are a
drop down list of the values in that field. For example, if the
field is "Country of Project", the user can choose from the available
countries via a drop down list rather than enter in "Kenya" in the
criteria box. Also, is it possible to let the user select more than
one country (via using the Control botton while selecting?) from this
drop down list? I've been trying to figure this out for days. ANY
HELP would be greatly appreciated!! Thanks.

The self-prompting parameter feature in Access queries is very limited and
seldom used in a "production quality" application. If you want the user to
be able to select from a list you need to use a form and have the query
reference a ComboBox on the form for its parameter instead of using the
[Enter your parameter] method in the query.
 
U

unicycle kid

Rick Brandt said:
Emily said:
How can I make a query so that the criteria for the parameters are a
drop down list of the values in that field. For example, if the
field is "Country of Project", the user can choose from the available
countries via a drop down list rather than enter in "Kenya" in the
criteria box. Also, is it possible to let the user select more than
one country (via using the Control botton while selecting?) from this
drop down list? I've been trying to figure this out for days. ANY
HELP would be greatly appreciated!! Thanks.

The self-prompting parameter feature in Access queries is very limited and
seldom used in a "production quality" application. If you want the user to
be able to select from a list you need to use a form and have the query
reference a ComboBox on the form for its parameter instead of using the
[Enter your parameter] method in the query.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

How can I use a list box or a combo box in a form as a query parameter
 
P

Pirduan

Hi Rick,

I have a similar problem. I've created a combo box with a list of topics
which the user can select.
In my Query window under Criteria, I've type: =
[Forms]![SelectCategory].[Combo2]

When I run my query, it does not capture the value i selected from the combo
box.

I tested my query using just a specific value; eg in Criteria, I keyed in
"*SAP*", and i return all the items which is related to SAP.

Care to help.

Rick Brandt said:
Emily said:
How can I make a query so that the criteria for the parameters are a
drop down list of the values in that field. For example, if the
field is "Country of Project", the user can choose from the available
countries via a drop down list rather than enter in "Kenya" in the
criteria box. Also, is it possible to let the user select more than
one country (via using the Control botton while selecting?) from this
drop down list? I've been trying to figure this out for days. ANY
HELP would be greatly appreciated!! Thanks.

The self-prompting parameter feature in Access queries is very limited and
seldom used in a "production quality" application. If you want the user to
be able to select from a list you need to use a form and have the query
reference a ComboBox on the form for its parameter instead of using the
[Enter your parameter] method in the query.
 
T

tina

your manual test used the asterisk wildcard, but your form reference
criteria did not - so unless you have a category which is called "SAP",
you're not going to get anything that way. add the asterisks to the form
reference criteria, as

"*" & [Forms]![SelectCategory].[Combo2] & "*"

hth


Pirduan said:
Hi Rick,

I have a similar problem. I've created a combo box with a list of topics
which the user can select.
In my Query window under Criteria, I've type: =
[Forms]![SelectCategory].[Combo2]

When I run my query, it does not capture the value i selected from the combo
box.

I tested my query using just a specific value; eg in Criteria, I keyed in
"*SAP*", and i return all the items which is related to SAP.

Care to help.

Rick Brandt said:
Emily said:
How can I make a query so that the criteria for the parameters are a
drop down list of the values in that field. For example, if the
field is "Country of Project", the user can choose from the available
countries via a drop down list rather than enter in "Kenya" in the
criteria box. Also, is it possible to let the user select more than
one country (via using the Control botton while selecting?) from this
drop down list? I've been trying to figure this out for days. ANY
HELP would be greatly appreciated!! Thanks.

The self-prompting parameter feature in Access queries is very limited and
seldom used in a "production quality" application. If you want the user to
be able to select from a list you need to use a form and have the query
reference a ComboBox on the form for its parameter instead of using the
[Enter your parameter] method in the query.
 
P

Pi

Hi Pirduan,

You have to requery the combo box after you select the data. Use the On
Exit event: me.combo2.requery.

Kathleen

Pirduan said:
Hi Rick,

I have a similar problem. I've created a combo box with a list of topics
which the user can select.
In my Query window under Criteria, I've type: =
[Forms]![SelectCategory].[Combo2]

When I run my query, it does not capture the value i selected from the combo
box.

I tested my query using just a specific value; eg in Criteria, I keyed in
"*SAP*", and i return all the items which is related to SAP.

Care to help.

Rick Brandt said:
Emily said:
How can I make a query so that the criteria for the parameters are a
drop down list of the values in that field. For example, if the
field is "Country of Project", the user can choose from the available
countries via a drop down list rather than enter in "Kenya" in the
criteria box. Also, is it possible to let the user select more than
one country (via using the Control botton while selecting?) from this
drop down list? I've been trying to figure this out for days. ANY
HELP would be greatly appreciated!! Thanks.

The self-prompting parameter feature in Access queries is very limited and
seldom used in a "production quality" application. If you want the user to
be able to select from a list you need to use a form and have the query
reference a ComboBox on the form for its parameter instead of using the
[Enter your parameter] method in the query.
 
I

Imran

Same problem here. Still unable to resolve it. kindly help.

Pirduan said:
Hi Rick,

I have a similar problem. I've created a combo box with a list of topics
which the user can select.
In my Query window under Criteria, I've type: =
[Forms]![SelectCategory].[Combo2]

When I run my query, it does not capture the value i selected from the combo
box.

I tested my query using just a specific value; eg in Criteria, I keyed in
"*SAP*", and i return all the items which is related to SAP.

Care to help.

Rick Brandt said:
Emily said:
How can I make a query so that the criteria for the parameters are a
drop down list of the values in that field. For example, if the
field is "Country of Project", the user can choose from the available
countries via a drop down list rather than enter in "Kenya" in the
criteria box. Also, is it possible to let the user select more than
one country (via using the Control botton while selecting?) from this
drop down list? I've been trying to figure this out for days. ANY
HELP would be greatly appreciated!! Thanks.

The self-prompting parameter feature in Access queries is very limited and
seldom used in a "production quality" application. If you want the user to
be able to select from a list you need to use a form and have the query
reference a ComboBox on the form for its parameter instead of using the
[Enter your parameter] method in the query.
 
D

Douglas J. Steele

Are you certain that the combo box is bound to the column you think it is?
In otherwords, does [Forms]![SelectCategory].[Combo2] return the value you
think it should?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Imran said:
Same problem here. Still unable to resolve it. kindly help.

Pirduan said:
Hi Rick,

I have a similar problem. I've created a combo box with a list of topics
which the user can select.
In my Query window under Criteria, I've type: =
[Forms]![SelectCategory].[Combo2]

When I run my query, it does not capture the value i selected from the
combo
box.

I tested my query using just a specific value; eg in Criteria, I keyed in
"*SAP*", and i return all the items which is related to SAP.

Care to help.

Rick Brandt said:
Emily Bright wrote:
How can I make a query so that the criteria for the parameters are a
drop down list of the values in that field. For example, if the
field is "Country of Project", the user can choose from the available
countries via a drop down list rather than enter in "Kenya" in the
criteria box. Also, is it possible to let the user select more than
one country (via using the Control botton while selecting?) from this
drop down list? I've been trying to figure this out for days. ANY
HELP would be greatly appreciated!! Thanks.

The self-prompting parameter feature in Access queries is very limited
and
seldom used in a "production quality" application. If you want the
user to
be able to select from a list you need to use a form and have the query
reference a ComboBox on the form for its parameter instead of using the
[Enter your parameter] method in the query.
 

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