Hello and thank you for any attention my post may receive.
My goal is to have multiple cascading combo boxes, and I have succeeded with the first two. I receive a syntax error with the third.
In my first code below, cboMake populates as it should after cboUnit is updated. However the second piece of code throws a syntax error on the WHERE criteria when I click into cboModel.
cboUnit is unbound with a ValueList rowsource (1;2;3;4;5;6;7).
cboMake is unbound with the below code (cboUnit_AfterUpdate) as rowsource, an rowsource type is Table/Query.
cboModel is unbound with the below code (cboMake_AfterUpdate) as rowsource, an rowsource type is Table/Query.
Thank you again!
My goal is to have multiple cascading combo boxes, and I have succeeded with the first two. I receive a syntax error with the third.
In my first code below, cboMake populates as it should after cboUnit is updated. However the second piece of code throws a syntax error on the WHERE criteria when I click into cboModel.
cboUnit is unbound with a ValueList rowsource (1;2;3;4;5;6;7).
cboMake is unbound with the below code (cboUnit_AfterUpdate) as rowsource, an rowsource type is Table/Query.
cboModel is unbound with the below code (cboMake_AfterUpdate) as rowsource, an rowsource type is Table/Query.
Code:
Private Sub cboUnit_AfterUpdate()
On Error Resume Next
Me.cboMake = Null
Me.cboModel = Null
cboMake.RowSource = "Select Make from tblUnit where (ID_Unit=" & [Forms]![frmUnitNew]![cboUnit] & ")"
cboMake.Requery
End Sub
Private Sub cboMake_AfterUpdate()
On Error Resume Next
Me.cboModel = Null
cboModel.RowSource = "Select Model from tblUnit where (ID_Unit=" & [Forms]![frmUnitNew]![cboUnit] & " AND Make=" & [Forms]![frmUnitNew]![cboMake] & ")"
cboModel.Requery
End Sub
Thank you again!