By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

Label Visibility Based On Field Count In Report

P: 29
This is a 2 parter, but right now I want to focus on the second part. I have "labels" which are text boxes, and the text for the label is only visible when there is a value in the field its related to. here is an example of one of them


Expand|Select|Wrap|Line Numbers
  1. =(IIf(IsNull([rptPath]),Null,"FILENAME / DOC #"))

however, if the value in the first row of the report is null for this field (or any field with the same setup and are pointing to other fields) the label text doesnt appear. I tried doing


Expand|Select|Wrap|Line Numbers
  1. =(IIf(IsNull(Count([rptPath])),Null,"FILENAME / DOC #"))

but I get an #Error in the field. logically, if it is only looking at the first row on the report to decide whether to show the label text or not, a count or sum would let it know there are more than 1 record displaying. since Count doesnt work, how would I have it look at all records displaying and not just the first to decide whether to show the record?


the first part of this whole thing is the fact the report is tied to a form of checkboxes. the checkboxes make the fields on the report visible/invisible so a user can decide what values they want on the report so they dont have to print every available field. so far it works fine. when I check a box on the form, and load the report, the field loads. when it is unchecked, the field doesnt load. the issue is that if the first several fields ar enot checked but the rest are, the remaining fields (and "labels") are not sliding down to fill in all the blank space being created from the missing data fields. I have them all set to Can Shrink/Grow, but thats isnt working. Here is an example of one of the fields for that setup


Expand|Select|Wrap|Line Numbers
  1. =IIf([Forms]![zfrm_test_visible_rpt_fields].[chk_filename].[Value]=False,Null,[Path])
Dec 20 '11 #1
Share this Question
Share on Google+
2 Replies


tuxalot
100+
P: 200
Try varying the fore color of the text. Using conditional formatting you can make the fore color match the back color rendering it "invisible". See if this gets you heading in the right direction at least for this part.
Jan 15 '12 #2

NeoPa
Expert Mod 15k+
P: 31,489
Tux's suggestion might work. Here's why your approach cannot (Why Values in Unbound Form Controls do not Persist). Reports and forms in this area behave very similarly.

An alternative might be to trigger event code on each format of the detail section.
Jan 16 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.