Select Queries - Like [...] & "*"

Firesaferescue

New member
Local time
Today, 19:03
Joined
Jan 7, 2008
Messages
3
Hi everybody, I have a small question.

In some selection queries I am using the expression Like [Please select city] & "*", which results in a text box, opening when starting up the query.

Does anybody knows if, instead of typing a city name, it is possible to show all cities in a pull down list in order to select them?

Thanks a lot!
 
You should use a form to capture your user input instead of a prompt. Then you can use a combo box to provide a drop down selection.
 
Hi Neil,

DO you have indication for me on how to do this? My experience with this type of query is not really sufficient.....

Thanks!
 
First you need a list of the valid cities. A query is probably the best way to do this based on your existing data. Make sure you select the 'Unique Values' option so that you get each city only once in the list and sort them into alphabetical order.

Now create a new blank form in design view, not bound to any table or query. Use the combo box wizard to create a combo box, base the list of values on the query you made above and choose the 'remember the value for use later option.

Now open the query that your users use and replace Like [Please select city] & "*" with [Forms]![NameOfYourForm]![NameOfYourComboBox]

Go back to your form and use the Command Button Wizard to create a button that opens the user query you have just changed. Bob's your uncle.
 

Users who are viewing this thread

Back
Top Bottom