Omit a field if a checkbox is active (1 Viewer)

setis

Registered User.
Local time
Yesterday, 16:30
Joined
Sep 30, 2017
Messages
127
Hi all,

Is it possible to not showing a specific field in a report based on a query if a checkbox in the same query is active?
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 19:30
Joined
Jan 23, 2006
Messages
15,379
??? Not sure I understand??

If the recordsource of a report is based on a query, and if that query does NOT include a specific field, then that field will not be available to the report. But I may not be answering your question.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:30
Joined
May 7, 2009
Messages
19,242
the eaiest thing to do us copy the report and rename it. remove the fields you dont want to show. depending on the chkbox display the appropriate repot.
 

setis

Registered User.
Local time
Yesterday, 16:30
Joined
Sep 30, 2017
Messages
127
??? Not sure I understand??

If the recordsource of a report is based on a query, and if that query does NOT include a specific field, then that field will not be available to the report. But I may not be answering your question.

I have just realized that I should solve this in the query itself, not in the report.

The issue is that I have a checkbox field and a calculated field. The calculated field will always produce a number, but if the checkbox field is active, I want that number to be "0".

The question would be How would the query criteria should be to do something like "if [checkbox] is active; 0; [value1]" does it make sense?
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 19:30
Joined
Jan 23, 2006
Messages
15,379
Check the info here regarding iif
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:30
Joined
May 7, 2009
Messages
19,242
if the form is still open when the reoirt is run, makr the Control Source of the field you want to hide to:

=Iif(Forms! yourForm! yourChkbox, Null, [fieldToHide])


before you do this rename the textbox to anything other than its fieldname so you will not run on circular reference error.
 

Users who are viewing this thread

Top Bottom