Linking a list box to the Query criteria

  • Thread starter Thread starter skipper190
  • Start date Start date
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
 
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.
 
Back
Top