Parameter Query from a list box

euanhampton

New member
Local time
Today, 07:50
Joined
Mar 7, 2007
Messages
5
Hi, Anyone got any ideas how I can create a query that runs from the selection in a list box. What I need to do is when the user selects an option in the List box for them to select a button to the right which acknowledges the secletion and then runs a query with the selection as the criteria.

Any ideas???

euan Hampton
 
In the OnClick subroutine of the button, loop through the items in the list box looking for the entry that was selected. Once it is found, store it in a variable then run the parameterized query:

set qdf = currentdb().querydefs("ParameterizedQueryName")
qdf!varParameter = varChosenItem
qdf.execute

This assumes you know how to create a parameterized query.

John M Reynolds
 

Users who are viewing this thread

Back
Top Bottom