[AccessD] A2K: Filtering a pick list

John W. Colby jwcolby at colbyconsulting.com
Wed Mar 3 07:19:00 CST 2004


I have a class for each control on the form.  Each data class has a
"dependent control" collection that I can tell the class in the form's
OnOpen "This control (combos, lists and subforms mostly) is dependent on
you".  Thus when any control changes, it's Afterupdate event checks the
DependentControl collection and calls a requery method of that dependent
class (anything in the collection).  That classes' Requery method requeries
its control, then iterates ITS dependent control collection calling the
requery method of all of ITs dependent controls.  Thus the requery of a
parent object ripples down the dependent object chain automatically
requerying all dependent children / grandchildren etc.

For YOUR purposes (assuming you don't have a framework), each control's
AfterUpdate would need to requery that one control.  That one control (the
combo) would then reference all those other controls in it's SQL or query.

In general, that is how it's done.

John W. Colby
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Darren DICK
Sent: Wednesday, March 03, 2004 6:17 AM
To: AccessD List
Subject: [AccessD] A2K: Filtering a pick list


Hello all
I have a very large list box that lists all the products (in this case
chairs) in a db
Each chair in tblChairs has many fields but in this case the ones I am
interested
in are ChairID, SupplierID, BackTypeID, RangeID, StyleID

So on the same form as this very large list box of chairs, I have combo
boxes -
yep you guessed it - 4 of 'em - cboSuppliers, cboBackTypes, cboRanges,
cboStyleID

I wanna filter the large list box based on the values in all or any
combination of the combo boxes.

EG
Say supplier 5 = Acme Manufacturing and in the whole dB there are 100 chairs
made by Acme
Say of that 100 that Acme produce 38 of em have a Backtype of 2 (as in Low
=1 medium=2 High=3 etc)

I would want the large list to instantly decrease to 100 items if I selected
Acme from the Suppliers combo.
Then I would want that list to further decreas to 38 when I choose Medium
back
PSUEDo = show me evert chair in the dB with supplier ID = 5 and BackType = 2
etc etc and then somehow accept the various combinations of combo choices.

Is there a clever or easy way of doing this without writing a zillion sql's
then selecting the correct one
and making it the listbox row source? <yech>

Many thanks in advance

Darren


--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list