Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how refer to 'nothing' in a query 1

Status
Not open for further replies.

Pampers

Technical User
Apr 7, 2004
1,300
AN
Hi everyone,
Not sure if it can be done, but I have a criterium in my query which refers to a form-checkbox (chkBox). All is well, the criterium can be True or False and the query runs ok. But what can I do to ignore the criterium completely so the query returns True and False values. Tried this in the criterium, but not luck:
[Forms]![frmSchapkaartSelectie]![chkHuismerk]=False

Pampers [afro]
Keeping it simple can be complicated
 
But what can I do to ignore the criterium completely so the query returns True and False values.
Remove it as a criterium or use a different query. Are you kidding?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Hi Traingamer,
Yes of course that (remove criterum) is an option. But then I have to create a new query, and that is what I try to avoid.

New thought. The user has actually three options with the checkbox, nothing, true or false. Maybe I could set the checkbox to triple-state and then refer to it?




Pampers [afro]
Keeping it simple can be complicated
 
I guess I'm not understanding the real question.

Do you want the query to return only true values if the box is checked and all values if the box is unchecked? Or something else?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Sorry for the confusing,
I think I want this:

chk = true, return true (checked)
chk = false, return false (unchecked)
chk = null, return true and false (not checked)

Pampers [afro]
Keeping it simple can be complicated
 
Sorry but that does not compute.

Queries return views (i.e. tables). They may indeed be one-row, one-column tables with a field value in that row and column that is TRUE, FALSE or NULL but it's still a table ... not a value.

Second, what's the point of running a query when you already know the answer from the state of the checkbox?

Perhaps if you post the query we can get a better feel for what you are trying to accomplish.
 
Criteria:
=[Forms]![frmSchapkaartSelectie]![chkHuismerk] OR [Forms]![frmSchapkaartSelectie]![chkHuismerk] Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi Golom,
I mean when the checkbox (chkBox) is checked a table/view will returned by the query where all the values for the field where the criterium is set will be TRUE.

When the checkbox is unchecked (false), a table/view will be returned by the query where all the values for the field where the criterium is set will be FALSE

When the checkbox is NULL (triple state), a table/view will returned by the query with all the records, as if there wasn't a criterium set.

Indeed this can be done, like PHV writes (thanx). The checkbox on the form has to be set to triple state.

example:
Code:
SELECT Table1.ID, Table1.Name, Table1.Boolean
FROM Table1
WHERE (((Table1.Boolean)=[Forms]![Form3]![Check0])) OR (([Forms]![Form3]![Check0] Is Null));








Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top