Linking a list box to the Query criteria

S

skipper190

I need to link a list box in a form to the criteria box in
the query.
I have a list box in my form that shows the different
options that i want to put into the criteria box in the
query.
the query is loaded into my form in the instance of a
subform. When i click on one of the options in the list
box i want the query search to search for the name i
selected in the box.

can any one help me?
Thank you
 
J

John Vinson

I need to link a list box in a form to the criteria box in
the query.
I have a list box in my form that shows the different
options that i want to put into the criteria box in the
query.
the query is loaded into my form in the instance of a
subform. When i click on one of the options in the list
box i want the query search to search for the name i
selected in the box.

can any one help me?
Thank you

You can use a Criterion of

= [Forms]![NameOfYourForm]![NameOfTheListbox]

to have the query look to the form control for the searched value. You
will probably need to Requery the subform in the AfterUpdate event of
the listbox.
 

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