I have the cascading filters working perfectly for all my different applications. I now have a number thats in a combo box but I know its a different data type. How should I modify my code? The combo box causing issues is cbosupport as its a number data type while the others are text.
Code:
Private Sub cboSupport_AfterUpdate()
Dim strFilter As String
If Len(Me.cboProductFilter & vbNullString) > 0 Then
strFilter = "[Product]=" & Chr(34) & Me.cboProductFilter & Chr(34) & " AND "
End If
If Len(Me.cboSupport & vbNullString) > 0 Then
strFilter = strFilter & "[Support Level]=" & Chr(34) & Me.cboSupport & Chr(34) & " AND "
End If
If Len(Me.Combo85 & vbNullString) > 0 Then
strFilter = strFilter & "[Active Ingredient]=" & Chr(34) & Me.Combo85 & Chr(34) & " AND "
End If
If Right(strFilter, 5) = " AND " Then
strFilter = Left(strFilter, Len(strFilter) - 5)
End If
Me.Filter = strFilter
Me.FilterOn = True
End Sub
Last edited: