strFilter = "orderstatus And field22 Like '*" & _. ???? I tried many things but nothing works
You MUST explicitly search fields.
Code:
Private Sub txtFilter_AfterUpdate() Dim strFilter As String
Dim strFilter as String
If Len(Trim(Me.txtfilter.Value & vbNullString)) > 0 Then
strFilter = "orderstatus Like '*" & txtBox & "*'"
strFilter = strFilter & " AND field22 = " & Me.SomeControl 'if field22 is a number
Me.Filter = strFilter
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
End Sub
Note: there needs to be a lot more checking in the code.
See Allen Browne's example at http://allenbrowne.com/ser-62code.html