How do I not show a label in a report if a data field is empty

C

Christophe M.

I am trying to dynamically show or not show a label based on whether a
specific datafield is empty or not in a report. How would I do this?
 
S

Steve Schapel

Christophe,

One way is to replace the label with an unbound textbox. You can format
the textbox to look the same as the label would. And in its Control
Source put the equivalent of...
=IIf(IsNull([YourDateField]),Null,"Your label text")
This is how I would do it.

Another approach is to write code in the Format event of the report
section where the label is, something like this...
Me.YourLabel.Visible = Not IsNull(Me.YourDataField)
 
O

Ofer

On the on print section of the report where the field placed write the code
if isnull(me.fieldname) then
me.lablename.visible=false
else
me.lablename.visible=true
end if
 
Top