I am attempting to filter out a subform when I select a value in a combo box, My problem is that whatever value I select I get the following error message: - RunTime error 3464 - Data type mismatch, and the debugger points to the 4th line in my code. Not sure where the data type mismatch is. Could the issue be with the Unit_Description field? It's just a short text field type in the table it resides in.
Private Sub cboUnitDescription_AfterUpdate()
Dim myDescription As String
myDescription = "Select * from tblTraining where ([Unit_Description] = " & Me.cboUnitDescription & ")"
Me.tblSubTrainingForm.Form.RecordSource = myDescription
Me.tblSubTrainingForm.Requery
End Sub
Private Sub cboUnitDescription_AfterUpdate()
Dim myDescription As String
myDescription = "Select * from tblTraining where ([Unit_Description] = " & Me.cboUnitDescription & ")"
Me.tblSubTrainingForm.Form.RecordSource = myDescription
Me.tblSubTrainingForm.Requery
End Sub