Hiding labels on reports

  • Thread starter Thread starter BazEWR
  • Start date Start date
B

BazEWR

How do you hide the labels on a report when the text box next to it is null?
And does anyone have the code to make the alternating background color for
each record result in details?
 
BazEWR said:
How do you hide the labels on a report when the text box next to it is null?
And does anyone have the code to make the alternating background color for
each record result in details?


If the label is not attached to another cotrol, hide the
label:
Me.thelabel.Visible = Not IsNull(Me.thetextbox)

If the label is attached to a text box and you want the text
box and its section to shrink, then Make the text box
invisible.

Either way, put the code in the Format event of the section
containing the label/textbox.
 
In report design view, right-click the label and Change To | Text box.

Then enter an expression in its Control Source that only shows up when the
real text box has data. For example, if the label was attached to the City
text box, use:
=IIf([City] Is Null, Null, "City:")

You will find this is faster than code in the report's events, and you can
shink this quazi-label by settings its Can Shink property to Yes.
 
Back
Top