p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Expert One-on-One Access Application Development (http://p2p.wrox.com/forumdisplay.php?f=131)
-   -   Subform Filter using Multiple Combo boxes (http://p2p.wrox.com/showthread.php?t=50241)

natwong November 13th, 2006 03:07 PM

Subform Filter using Multiple Combo boxes
 
Hi All,

I'm a newbie in terms of Access and some of its functionality [:o)]. I've been stuck on this problem for a couple days, even after searching the Web, etc.

Currently I have five combo boxes that are multiselects in my main form. I need to use these combo boxes to filter a subform within my main form.

My combo boxes are as follows:
1. A - 4 select options
2. B - 10 select options
3. C - 4 select options
4. D - 3 select options
5. E - 4 select options

My subform is a listing of all the possible combinations of these select options (therefore there are 4 x 10 x 4 x 3 x 4 records).

I am having trouble understanding how to link these unbound combo boxes to the subform to make the filter work once a user has selected their options from the 5 combo boxes.

[u]Case example</u>:
If I select option 1, 2, and 3 from combo box A, and options 2 from combo box B, C, D, and E; I would want the subform to filter based on this query:

Code:

SELECT * FROM TABLE WHERE
(A_id = 1 OR A_id = 2 OR A_id = 3) AND
B_id = 2 AND
C_id = 2 AND
D_id = 2 AND
E_id = 2;

I hope this makes sense. Can anyone please help me out on this one. :D I'd be indebted to you! I really appreciate it :D

Any help on which functions or what code to put and where to put it would be great!

Thanks,
Nate



All times are GMT -4. The time now is 06:09 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.