S
Sarah Huibregtse
I have been struggling to add a 3rd combo box to my first two synchronized combo boxes. Please help!! Here is what I've done so far:
I have 3 tables (Course, Session, Topic)
The first Combo Box is pulling from the Course table with no issues. In the AfterUpdate I have the following code:
Private Sub cboCourse_AfterUpdate()
Me.cboSession.RowSource = "SELECT SessionTitle FROM " & _
" Session WHERE CourseID = " & Me.cboCourse & _
" ORDER BY SessionTitle "
Me.cboSession = Me.cboSession.ItemData(0)
End Sub
Works perfectly with the 2nd Combo Box. Then I took that same code and added it to the 2nd Combo Box's After Update. However, when I leave the WHERE in it I get no results. If I take the WHERE out I get all Topics from my table.
Private Sub cboSession_AfterUpdate()
Me.cboTopic.RowSource = "SELECT TopicTitle FROM " & _
" Topic WHERE SessionID = " & Me.cboSession
Me.cboTopic = Me.cboTopic.ItemData(0)
End Sub
So basicly I know that my WHERE statement is correctly coded. I've tried referencing the Form fields too and haven't been successful.
Please help! This is my first attempt at this detailed of a database and I'm getting very frustrated.
Thanks!!
Sarah
EggHeadCafe - Software Developer Portal of Choice
WPF And The Model View View Model Pattern
http://www.eggheadcafe.com/tutorial...b-7374d3da3425/wpf-and-the-model-view-vi.aspx
I have 3 tables (Course, Session, Topic)
The first Combo Box is pulling from the Course table with no issues. In the AfterUpdate I have the following code:
Private Sub cboCourse_AfterUpdate()
Me.cboSession.RowSource = "SELECT SessionTitle FROM " & _
" Session WHERE CourseID = " & Me.cboCourse & _
" ORDER BY SessionTitle "
Me.cboSession = Me.cboSession.ItemData(0)
End Sub
Works perfectly with the 2nd Combo Box. Then I took that same code and added it to the 2nd Combo Box's After Update. However, when I leave the WHERE in it I get no results. If I take the WHERE out I get all Topics from my table.
Private Sub cboSession_AfterUpdate()
Me.cboTopic.RowSource = "SELECT TopicTitle FROM " & _
" Topic WHERE SessionID = " & Me.cboSession
Me.cboTopic = Me.cboTopic.ItemData(0)
End Sub
So basicly I know that my WHERE statement is correctly coded. I've tried referencing the Form fields too and haven't been successful.
Please help! This is my first attempt at this detailed of a database and I'm getting very frustrated.
Thanks!!
Sarah
EggHeadCafe - Software Developer Portal of Choice
WPF And The Model View View Model Pattern
http://www.eggheadcafe.com/tutorial...b-7374d3da3425/wpf-and-the-model-view-vi.aspx