Cascading Combo Boxes to Control Continuous Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

For the database I am currently working on, my employer would like th
ability to use multiple combo boxes in order to filter the database.
For instance the structure of the company is based on regions, whic
are managed by a number of coordinators, who oversee a large group o
associates. I would like to use a combo box so that people accessin
the database can choose a particular region and then have a secon
combo box that only shows those coordinators located within tha
region

I have been able to get to this point, but am at a loss as to how t
get the resulting selection of a coordinator to limit a continuou
subform

Any help you could provide would be appreciated

Jonny
 
Based on your description you want to limit the list of associates displayed
in a continuous subform based on the selection of a CoOrdinator?

If you are wanting to view Associates based on a single CoOrdinator
selection, you can simply set the Filter option for the subform to the combo
control which allows you to select a CoOrdinator:
e.g.
=Forms!FormName!ComboName

If you are wanting to view Associates based on multiple CoOrdinator
selections, one way is to generate a CSV list, assign this CSV list to a
hidden textbox, & then use In(CSV list) as your filter criteria. This is a
little more challenging as you need to enumerate through the control in
order to get all of the selections:
e.g.
Private Sub CoOrd_AfterUpdate
Dim ctl As Control
Dim varItem
Dim strTemp

Set ctl = Me.CoOrd.ItemsSelected
For Each varItem In Ctl.ItemsSelected
strTemp = strTemp & ", " & Ctl.ItemData(varItem)
Next varItem

strTemp = Left(strTemp,Len(strTemp) - 2)

Me.HiddenTextControl = strTemp
End Sub
 
On my website (see sig below) is a small sample database called:
"CascadingComboInSubform2k.mdb" which illustrates how to do this.
 
Hi Roger, I probably should have been clearer. My goal is not to have cascading combo boxes within a subform, rather to have cascading combo boxes on the main form which control a continuous subform. Basically the user selects the region and picks from the resulting list of coordinators. These two selections then effect how the subform displays.

Cameron
 
Back
Top