I have two combo boxes. Depending on the Value I chose in Combo1, I need it to populate Combo2. This is how my code looks, but i keep getting a "Data Type Mismatch in Criteria Expression" when I click on combo2. What am i doing wrong????
Private Sub cboIssuance_AfterUpdate()
Dim dbs As DAO.database, rst As DAO.Recordset, stSQL As String, stSQL2 As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblLUSection"
stSQL = "Select Section_Code, Section from tblLUSection where Section_Code >= 50"
stSQL2 = "Select Section_Code, Section from tblLUSection where Section_Code < 50"
If Me.combo1 = "S" Then
Me.combo2.RowSourceType = "Table/Query"
Me.combo2.RowSource = stSQL
Else
Me.combo2.RowSourceType = "Table/Query"
Me.combo2.RowSource = stSQL2
End If
End Sub
Private Sub cboIssuance_AfterUpdate()
Dim dbs As DAO.database, rst As DAO.Recordset, stSQL As String, stSQL2 As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblLUSection"
stSQL = "Select Section_Code, Section from tblLUSection where Section_Code >= 50"
stSQL2 = "Select Section_Code, Section from tblLUSection where Section_Code < 50"
If Me.combo1 = "S" Then
Me.combo2.RowSourceType = "Table/Query"
Me.combo2.RowSource = stSQL
Else
Me.combo2.RowSourceType = "Table/Query"
Me.combo2.RowSource = stSQL2
End If
End Sub