Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From table to form (list box), then from form to query 1

Status
Not open for further replies.

VBAguy22

IS-IT--Management
Aug 5, 2003
180
CA
Hi
I have a form with a list box allowing multiple selection.

I want to be able to run a query and display values in a certain field according to the selection made in the box.

Say, my box is fiscal years. If the user selects 1999, 2001, 2004 -- my query should only pick up fields in a table (myTable) for those years.

I managed to do it before, but without multiple selection. I had a listbox where the user could only select one value and by using IF statement I managed to bring down the fields for that value only.
How do I go about it using multiple selection list box?
 
The ItemsSelected collection of a MultiSelect ListBox is accessible only by VBA, so you have to build your SQL (at least the WHERE clause) on the fly in code.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Would you have an example of how you'd do that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top