Cascade Combo - 3 tiers?

fraser_lindsay

Access wannabe
Local time
Today, 09:56
Joined
Sep 7, 2005
Messages
218
Hello,

I followed the Microsoft guide detailing how to set up two cascading combo boxes. I would like to add a third box to the cascade. I have tried making some assumptions based on the code in the example but I can't get it to work.

I have three queries set up; qryBusiness, qryBusinessUnit and qryLocation.

I am using one form; frmToolInfo.

I have three combo set up; cboBusiness, cboBusinessUnit and cboLocation.


I amended my code to the following:


Private Sub cboBusiness_AfterUpdate ()
Me!cboBusinessUnit.Requery
Me!cboBusinessUnit.SetFocus
End Sub

Private Sub cboBusinessUnit_AfterUpdate ()
Me!cboLocation.Requery
Me!cboLocation.SetFocus
End Sub

Private Sub Form Current ()
Me!cboBusinessUnit.Requery
Me!cboLocation.Requery
End Sub



I want to cascade down from Business, to Business Unit to Location.


Can anyone advise me as to what I've done wrong here.

Thanks.
 
Try something like this as the row source for cboBusinessUnit (the second combo in the series):

SELECT YourTableName.YourField FROM YourTableName WHERE (((YourTableName.FieldName)=[Forms]![frmToolInfo]![cboBusiness]));


Amend the names to reflect your names. For more combos, adjust the values to the control(s) you are using.
 
Thanks for the response, unfortunately I've had no luck using your method so far.

I have been adjusting my queries which is possibly where the problem may lie, but I still can't get all three to synchronise.
 
Fixed it at last. There was a probelm with one of my combo boxes being bound to a mispelled fields. I also re-wrote the queries that the row sources were based on and it's now working. Must have been an error in one of those.
 

Users who are viewing this thread

Back
Top Bottom