I am trying the code, but not having any luck. I want to filter the combo boxes on the form, the combo box this filters is cboproductname but if it equals "General" then cboproductname is not required
Code:
Dim strWhere As String
Dim lngLen As Long
If Not IsNull("Me.cboproductcat") Then
strWhere = strWhere & "([Productcat] = " & Me.cboproductcat & ") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then 'Nah: there was nothing in the string.
MsgBox "No criteria", vbInformation, "Nothing to do."
Else 'Yep: there is something there, so remove the " AND " at the end.
strWhere = Left$(strWhere, lngLen)
'For debugging, remove the leading quote on the next line. Prints to Immediate Window (Ctrl+G).
'Debug.Print strWhere
'Finally, apply the string as the form's Filter.
Me.Filter = strWhere
Me.FilterOn = True
End If
Thank you for any help provided