Label Visibility Based On Field Count In Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mindbenderz
    New Member
    • Oct 2011
    • 29

    Label Visibility Based On Field Count In Report

    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


    Code:
    =(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


    Code:
    =(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


    Code:
    =IIf([Forms]![zfrm_test_visible_rpt_fields].[chk_filename].[Value]=False,Null,[Path])
  • tuxalot
    New Member
    • Feb 2009
    • 200

    #2
    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.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      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.

      Comment

      Working...