I use the following code or something similar to create search forms. You can use wildcards to allow for beginig of field, middle of field search, etc. This example assumes there will always be a value in Field1.
Code:
If Not IsNull(Me.Field1) Then
strWhere = "[WorkOrder] LIKE '" & Me.Field1 & "'" ' a wild card is not used here. field must match exactly
Else
Exit Sub
End If
If Not IsNull(Me.Field2) Then
strWhere = (strWhere & " AND ") & "[Container] LIKE '" & Me.Field2 & "*'"
End If
If Not IsNull(Me.Field3) Then
strWhere = (strWhere & " AND ") & "[PO] LIKE '" & Me.Field3 & "*'"
End If