Run Query based on Selection in Combobox

E

erica hale

I need to run a query based on a what a user selects in a
combo box in a form. For example, if a user selects
policy no. #1234 from the drop down, then I would like a
command button on the form to run a query with that
parameter. How can I accomplish this? Thanks for any
help.
 
K

Kelvin

The easiest way is to put into the criteria in the qeury for PolicyNo

=Forms!NameOfForm!NameOfBox

That way when the query runs it will use the value in the form. Of course
this won't work if you close the form before the query runs.

Kelvin Lu
 
E

erica hale

Kelvin,

Sounds perfect! Thanks so much.
-----Original Message-----
The easiest way is to put into the criteria in the qeury for PolicyNo

=Forms!NameOfForm!NameOfBox

That way when the query runs it will use the value in the form. Of course
this won't work if you close the form before the query runs.

Kelvin Lu




.
 

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