Hide Labels and Textboxes with 0 value in report

jleval

Registered User.
Local time
Today, 16:09
Joined
May 16, 2012
Messages
53
I have a report that has a bunch of fields that often times have a zero value and need not be displayed. What I am trying to do is make those fields invisable and also shrink the detail section down whenever those values are hidden. I did some conditional formatting on the textboxes to make them invisable, but the lables are still there and the detail section remains the same size. Any ideas?:banghead:
 
Instead of conditional formatting, you can use this (in the On Format event of the section where the controls are. You would use

Code:
Me.ControlNameHere.Visible = Nz(Me.ControlWithValue,0)

If it has a zero, it will become invisible and, if it is anything but zero it would be visible. If the text box is bound associated with the text box, then it should go invisible as well without extra code. But if not you can add the same thing like

Code:
Me.ControlNameHere.Visible = Nz(Me.ControlWithValue,0)
Me.LabelNameHere.Visible = Nz(Me.ControlWithValue,0)

And make sure that the section's Can Grow/Can Shrink properties are set to YES, as well as the controls.
 
Awesome, thanks again
 
I am trying this and it doesnt seem to be working
 
Sorry, now that I saved it, it seems to be working fine, Thanks
 

Users who are viewing this thread

Back
Top Bottom