Linking Query Criteria to Form Checkbox

ot070707

Registered User.
Local time
Today, 18:23
Joined
Jan 28, 2009
Messages
10
I'm sure there's an easy answer to this but its stumping me right now;
I have a checkbox on a user input form.
If the user ticks the checkbox, I want the query to return all records.
If the box is unchecked, I want the query exclude certain records.
I have used :
Like (IIf([forms]![ReportSelection]![check96]=-1,"*",<>"ADC9999"))
This works fine when checked, but returns zero records when unchecked.
Can someone please tell me where I am going wrong.
Many thanks.
Mark
 
here's a cheater method:

---->Pick a character from the keyboard from that you KNOW is not in any record of the field you are using as criteria<----

FOR EXAMPLE, assume that the "+" sign would never be in the field you are checking. In this example, you can cheat the program this way:
PHP:
WHERE field NOT LIKE

IIf([forms]![ReportSelection]![check96]=-1,"+","ADC9999")
careful using LIKE without asteriks. You might need them to make it work
 
Many thanks for the advice.
I'll give it a go.
Best wishes.
Mark
 
Actually, you can also create a field which has this in it:

MyCrit:[Forms]![ReportSelection]![check96]= True OR <>"ADC9999"

And the Criteria for that field is TRUE.
 
Glad we could help. :)
 

Users who are viewing this thread

Back
Top Bottom