Cascading Issue

Chimp8471

Registered User.
Local time
Today, 02:23
Joined
Mar 18, 2003
Messages
353
i have a subform called Tbl_Trainingsubform

on here i have two combo boxes which i am trying to setup as casacading...i believe this is how they are referred to anyway.

combo box 1 is called cbosection the other is called cboactivity

i have a table called tbl_training which has the following

trainingID
Activity
Section

and here is my sql that i have put on the afterupdate of Section...

Private Sub cbosection_AfterUpdate()
On Error Resume Next
cboActivity.RowSource = "Select Tbl_Training.activity " & _
"FROM Tbl_Training " & _
"WHERE tbl_Training.section = '" & cboSection.Value & "' " & _
"ORDER BY Tbl_Training.activity;"
End Sub


what i am trying to achieve is that when the user selects from the section box, the combo box activity will then be limited to the relevant list

someone suggested trying the following:


Private Sub cbosection_AfterUpdate()
On Error Resume Next
cboActivity.RowSource = "Select Tbl_Training.activity " & _
"FROM Tbl_Training " & _
"WHERE tbl_Training.section = '" & me.cboSection & "' " & _
"ORDER BY Tbl_Training.activity;"
End Sub


but that didnt work either


what am i doing wrong


Andy
 
There is a good example in the FAQ section on cascading combo boxes. It takes a different approach from what you are doing, but i think it is much easier.
 
hi, thanks, but i have just tried the FAQ and entered cascading combo boxes and i got a sorry nothing found message, and tips to what i should search for ?
 

Users who are viewing this thread

Back
Top Bottom