query criteria

G

Guest

I am working on a query and for criteria statements (ex: enter color), I
would like to have a pulldown list, green, yellow, blue, versus typing in
"green" so that I can ensure no one chooses an option that doesn't exist.
Can anyone help???

Thanks!
 
R

Rick B

You would have to build a pop-up form with the options in a drop-down box,
then have the query get the data from that form.
 
F

fredg

I am working on a query and for criteria statements (ex: enter color), I
would like to have a pulldown list, green, yellow, blue, versus typing in
"green" so that I can ensure no one chooses an option that doesn't exist.
Can anyone help???

Thanks!

You cannot do this directly within a query.

Create a form (or use an existing form). Add a combo button that lists
the values you want available. Set the Combo LimitToList property to
Yes.

Add a command button to the form.
If this Query is being run just to be viewd, code the command button's
click event:

DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name

Code the query [Color] field criteria:
forms!FormName!ComboName

Open the form, select the color, click the button, the query will
display, and the form will be closed.
 
G

Guest

I am having some difficulty creating this form and doing the linking between
the query. Is there a site somewhere with some examples?

Thanks!
 

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