Check box filter help (Omit any records with the word "Complete")

cooh23

Registered User.
Local time
Today, 13:58
Joined
Dec 5, 2007
Messages
169
Hello All,

I have a search form that contains a subform. The subform is a result of a query.

Everything is working perfectly fine, but i want to add a checkbox that when checked, it will omit the records that contains the word "Complete"..

here's part of my code:
In the form, I have a text field called txt.UserName. If a user enters his/her username, the subform will populate all of the items associated under that username. (Wildcard can be used)
Code:
    If Me.txtUserName > "" Then
        varWhere = varWhere & "[UserName] LIKE """ & Me.txtUserName & "*"" AND "
    End If

Now, how do I convert the above code to a check box from a textfield?

Let's say the checkbox is called "chkcomplete"?

Thank you,
 
Cooh, this statement...
how do I convert the above code to a check box from a textfield?
doesn't really show any resemblance to this one...
Everything is working perfectly fine, but i want to add a checkbox that when checked, it will omit the records that contains the word "Complete"..
The second quote is the easiest to follow, and you can simply to this with a form filter. The two different syntax references you will want to use are these:
Code:
"NOT LIKE '*' & 'complete' & '*'"
Code:
"NOT LIKE '*complete*'"
If you do not want the sequence of characters "complete" to appear anywhere in the field you are trying to evaluate, then the WHERE clause will have to look like this:
Code:
"[textboxField] NOT LIKE '*' & 'complete' & '*' OR 
   [textBoxField] "NOT LIKE '*complete*'"
The above samples are what you are probably going to want to put into the WHERE clause of the subform (recordsource), upon execution of the code that populates it.

Also, be aware that the two syntax lines above return two very different sets of records.
 

Users who are viewing this thread

Back
Top Bottom