G
Guest
I'm trying to adapt a form from one of the Microsoft Templates (Issues
Database). There is an unbound form with various text boxes, which filters a
subform when the "search" command button is pressed. I've added several text
boxes to the form to correspond with fields in my table, and they work fine.
The code for the Location text box in the On_Click command of the Search
button is
' If Location
If Nz(Me.txtbLocation) <> "" Then
' Add it to the predicate - match on leading characters
strWhere = strWhere & " AND " & "tblDiscrepancies.LOCATION Like '*"
& Me.txtbLocation & "*'"
End If
This works fine, and all the other text boxes seem to work fine as well.
The problem i've run into, however, is that 3 fields in my table are
TRUE/FALSE. I've added check boxes to the form for these fields, but i'm not
entirely sure about the code i should use. If the user selects the check
box, I want the search to return only those records for which the field =
TRUE. If the user does not select the check box, I want the seach to return
ALL records, both TRUE and FALSE.
Any help would be appreciated!
Database). There is an unbound form with various text boxes, which filters a
subform when the "search" command button is pressed. I've added several text
boxes to the form to correspond with fields in my table, and they work fine.
The code for the Location text box in the On_Click command of the Search
button is
' If Location
If Nz(Me.txtbLocation) <> "" Then
' Add it to the predicate - match on leading characters
strWhere = strWhere & " AND " & "tblDiscrepancies.LOCATION Like '*"
& Me.txtbLocation & "*'"
End If
This works fine, and all the other text boxes seem to work fine as well.
The problem i've run into, however, is that 3 fields in my table are
TRUE/FALSE. I've added check boxes to the form for these fields, but i'm not
entirely sure about the code i should use. If the user selects the check
box, I want the search to return only those records for which the field =
TRUE. If the user does not select the check box, I want the seach to return
ALL records, both TRUE and FALSE.
Any help would be appreciated!