Hello:
I have created 3 cascading combo boxes, cboYEAR, cboCUSTOMER, cboOEM.
The database is based off the year. The cboCUSTOMER loads just fine afterUpdate, but I need to load the cboOEM based on the cboCUSTOMER and the cboYEAR. For some reason it won't work.
My code that I have for cascading the other combo boxes is:
Does anyone have any ideas for me? I appreciate any help in advance.
the link to the database for you is http://www.djflavi.com/sample/DatabaseOne.mdb
I have created 3 cascading combo boxes, cboYEAR, cboCUSTOMER, cboOEM.
The database is based off the year. The cboCUSTOMER loads just fine afterUpdate, but I need to load the cboOEM based on the cboCUSTOMER and the cboYEAR. For some reason it won't work.
My code that I have for cascading the other combo boxes is:
Code:
Private Sub cboCUST_AfterUpdate()
Me.cboOEM.RowSource = "SELECT fldOEM FROM" & _
" tblOEM WHERE fldCUSTID = " & _
Me.cboCUST & _
" tblOEM WHERE fldYRID = " & _
Me.cboYEAR & _
" ORDER BY fldOEM"
Me.cboOEM = Me.cboOEM.ItemData(0)
End Sub
Private Sub cboYEAR_AfterUpdate()
Me.cboCUST.RowSource = "SELECT fldCUSTOMER FROM" & _
" tblCustomer WHERE fldYRID = " & _
Me.cboYEAR & _
" ORDER BY fldCUSTOMER"
Me.cboCUST = Me.cboCUST.ItemData(0)
End Sub
Does anyone have any ideas for me? I appreciate any help in advance.
the link to the database for you is http://www.djflavi.com/sample/DatabaseOne.mdb