user559142
user559142

Reputation: 12517

Access- Parameterized SQL statement with dropdown list input

I have a parameterized SQL statement which takes a string as an input.

Instead, to avoid manual input error, I would like the user to be able to select the parameter value from a drop down list. I want the values of the drop down list to equal the distinct values in a column.

How can I achieve this?

Upvotes: 0

Views: 263

Answers (1)

iDevlop
iDevlop

Reputation: 25272

Create a form with a combo, a OK command button and a Cancel command button.
Refer to that combo in the condition of your query (use the wizard if you have trouble doing that).
Have the Ok button open the query, and the Cancel button close its parent form.
The combo RowSource should contain your SELECT DISTINCT.

Upvotes: 1

Related Questions