Cascading 3 Combo Boxes

jkoer

New member
Local time
Yesterday, 18:47
Joined
May 25, 2011
Messages
8
I am trying to cascade three combo boxes (Area>Bone>FracDesc1) and I have three tables (tblArea, tblBone, tblFracDesc1) that I am working with. I am able to connect the first two combo boxes so that when I select a value in the Area combo box, it filters the choices for the Bone combo box. However, when I select the value in the Bone combo box, I get a pop up saying "Enter Parameter Value." I cannot figure out how to get the Bone combo box to filter for the FracDesc1 combo box. Here is my Code:

Private Sub cboArea_AfterUpdate()
' Update the row source of the cboBone combo box
' when the user makes a selection in the cboArea
' combo box.
Me.cboBone.RowSource = "SELECT Bone FROM" & _
" tblBone WHERE Area = " & _
Me.cboArea & _
" ORDER BY ID"
Me.cboBone = Me.cboBone.ItemData(0)
Me.cboBone.Requery
End Sub

Private Sub cboBone_AfterUpdate()
' Update the row source of the cboFracDesc1 combo box
' when the user makes a selection in the cboBone
' combo box.
Me.cboFracDesc1.RowSource = "SELECT FracDesc1 FROM " & _
" tblFracDesc1 WHERE Bone = " & _
Me.cboBone & _
" ORDER BY ID"
Me.cboFracDesc1 = Me.cboFracDesc1.ItemData(0)
Me.cboFracDesc1.Requery

End Sub

Any help would be greatly appreciated!
 
What does the parameter box say? It should tell you what field it can't find, which generally means it's spelled wrong or the field doesn't exist.
 
The parameter box has the same value is the Bone combo box (e.g. when I select Scapula in cboBone, the parameter box says Scapula)
 
If the field is text try

Me.cboFracDesc1.RowSource = "SELECT FracDesc1 FROM " & _
" tblFracDesc1 WHERE Bone = '" & _
Me.cboBone & _
"' ORDER BY ID"
 
Awesome...it works now. Thanks a lot Paul
 
Ah good, glad it worked. Welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom