I’m using 9 combo boxes on a form to build a filter for a report. The filter builds just fine if the value in cboPt is NOT LIKE (“C*”) but as soon as I change it to NOT LIKE (“C*”) AND NOT LIKE (“F*”) I get a missing operator syntax error. I’m guessing the problem is the AND but don’t know how to work around it.
The ……s below are where I’ve redacted the code.
Dim strVehNum As String
Dim strProdTypeK As String
…….
Dim strF1 As String
Dim strF8 As String
…….
Dim strFilter As String
…….
If IsNull(Me.cboPt) Then
Else
strProdTypeK = Me.cboPt
End If
strF8 = “[ProdType] ” & strProdTypeK
……
strFilter = strF1 & ” And ” & strF8
How can I use “compound” criteria in the filter statement?