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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top