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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide/Show When False

Status
Not open for further replies.

Recursive

Technical User
Mar 4, 2003
3
GB
Hi

I have a query which has checkbox (yes/no) fields in it,

i am wondering when i use a report based on the query how can i filter out and show only the fields in a record with a yes value.

This would hide the values that are false in the record.

Thanks, any help will be cool
 
Hiding them if that means that the No value doesn't print is very easy. You can use the IIF function in the Text Control Source property for that fields control:
=IIf([Field1],"Yes",Null)

The above example will display Yes for a true value and a blank if a No value.

If this is not what you are looking for please get back with a little more info on exactly what you need. Bob Scriver
 
Hey bob thanks alot, the code worked,
but now i've ran into another problem, hiding the fields which = NO. causes gaps in my report

Is there a way so that if one is hidden the rest dont get effected.
 
It is hard to respond to your concerns as I can't see your report and what about it that you don't like. If you don't like having blanks then you can put some "---" in place of the blank so that something is printed but not a NO. This would probably be easier to read. You could focus in on just the "YES" answers and the column and row continuity would be maintained. Just use the following:
=IIf([Field1],"Yes","---")

Hopefully that helps you with your formatting problem. If not please get back with me and tell me what you would specifically like to do.
Bob Scriver
 
You might try running the report based on a query that is filtered to only show Yes reponses. In the Query Criteria for the Yes/No field, put =Yes and it will only pull ones that are yes, not both.

As for supressing spaces in reports that are empty, I do it with an IIf statement too, like this:

=IIf(([Reviewed Products]='0'),"","Reviewed Products, ")

Which says if the information in the Reviewed Products field is No (Access stores No's as 0) then print no space, otherwise, print "Reviewed Products" which makes more sense for me than just printing Yes there.
 
Celeste025 : As for the query suggestion I gathered from the posting that there would be multiple columns(fields) of Yes/No answers. The query filtering process would not work here. Recursive is questioning how to not have the blank gaps in the columns going across the row.

I believe this is visual thing, as with a small number of YES answers and the rest blanks it is difficult to follow across rows and columns easily. I believe that placing a "-" or "_" in the place of the No would help with this problem. Bob Scriver
 
I run a report with multiple fields of Yes/No and don't want blank spaces either, I want to supress the No answers completely. I do it with this piece of code:

=IIf(([Review Back Orders]='0'),"","Review Back Orders, ") & IIf(([Analyze Fill Rate]='0'),"","Analyze Fill Rate, ") & IIf(([Order Written]='0'),"","Order Written, ") & IIf(([Presented Business Plan]='0'),"","Presented Business Plan, ") & IIf(([Other]='0'),"","Other")

That prints nothing if it's no, or prints the desired phrase if yes. I'm not sure exactly what this user is looking for, but that worked for me when I had a similar problem with the Yes/No issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top