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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Multiple parameters from form to query

Status
Not open for further replies.

TMCraig

Technical User
Jan 8, 2004
4
US
I posted this in the general database forum, but it was suggested that I post in a more specific forum so I am trying it here.


First off I am using Access. I am trying to use listboxes with multi select enabled on a form to filter records from a table. I have several listboxes, each for a different field that needs to be filtered.

What I want to do is allow the user to select multiple parameters from each listbox and any records that meet those parameters be displayed.

eg.. they could select "Toyota" and "Ford" from 1 listbox and "2-door" from another listbox and all 2-door Toyotas and Fords would show up, but no Chevy's or 4-doors because those weren't selected.

Thanks.

I am able to use the following in the query criteria when multi select is not enabled-
[Forms]![formname]![listboxname]
The problem is getting the query to filter multiple parameters.
 
This is extremely tricky.

Because you have multiple select on, you can not just write a querry and get the value as in [Forms]![formname]![listboxname]. It will always return NULL.

In order to do what you want, you are going to have to write some VB code. Are you familiar with VB?

ChaZ
 
I have taken some VB classes, I've never used it within Access before though. I also have other resources at work that I could talk to once I know what direction to go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top