Select query based on a user choice (1 Viewer)

rodin

Registered User.
Local time
Yesterday, 23:23
Joined
Aug 25, 2006
Messages
12
Hi,

I would like to run a simple select query, where the CRITERIA is based on the user choice.
I have a form with a combo box, with a few choices, and a button that will trigger a macro with one query for now. I can store the choice in to a variable e.g. "town", using Microsoft VB code.
How can I transfer the variable to the CRITERIA field in the query, so whenever I chose a specific "town", my query will select the records for that specific town.
I want to use one query, and I don't want to have to "hard type the criteria in to the cells' query", but I would like to use a variable that can change and will be read it from the user choice through combo box.

If I am not clear enough, please let me know.

Thank you!
 

MStef

Registered User.
Local time
Today, 07:23
Joined
Oct 28, 2004
Messages
2,251
Hello rodin!

You don't need a Macro, you don't need a variable,
you don't need a command button.
Look at "DemoCoboQueryA2000.mdb.
 

Attachments

  • DemoComboQueryA2000.zip
    11.5 KB · Views: 234

rodin

Registered User.
Local time
Yesterday, 23:23
Joined
Aug 25, 2006
Messages
12
Thank you! It is working.
 

Users who are viewing this thread

Top Bottom