search form using checkbox

cyberpac9

Registered User.
Local time
Today, 10:37
Joined
Jun 6, 2005
Messages
70
i am creating an unbound form that allows a user to search for records using any or all the fields on the search form. my vba goes something like this:
Code:
If Not IsNull(Me!TicketNumber) Then strFilter = strFilter & " And [TicketNumber]='" & Me!TicketNumber & "'"
If strFilter <> "" Then strFilter = Mid(strFilter, 5)
DoCmd.OpenForm "frmSearchResults", acFormDS, , strFilter
i have a "if not isnull" for every field on the form. one field i will need to be able to search is a checkbox. when the checkbox is added to the form it is initially greyed out. if you put a checkmark in there and then remove the checkmark it is white. are the greyed out and white states the same? do they both equal 0? i do not have the checkmark setup as "triple state". i would like to have the grey and white states be equal (no or 0) and the checked state yes (or -1).

how would i go about adding code to add a checkbox in my search criteria?
 
if you set the checkbox's default value to False it will start out white.

You just check a checkbox for True or False in the criteria.

HTH

Peter
 
Bat17 said:
if you set the checkbox's default value to False it will start out white.

You just check a checkbox for True or False in the criteria.

HTH

Peter
got it...i had to set the default to 0 or -1....what this does is allow me to search for 0 and -1....now, if i wanted to return all of the results (0 and -1) should i use the triple state? if so, what value represents the third state?
 
ok i got it....the third value is NULL...i can now search for NULL, Yes and No...thanks...
 

Users who are viewing this thread

Back
Top Bottom