Hiding Labels in Reports if Field Blank

  • Thread starter Thread starter mjones
  • Start date Start date
M

mjones

Hi All,

These fields in the PageFooterSection are:

DueDate - date/time field with DueDateLabel attached
Terms - text field with TermsLabel attached.

I've tried setting the fields to Yes for grow and shrink

I've tried code like this:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
If Me.Terms = "" Then
Me.TermsLabel.Visible = False
Else
Me.TermsLabel.Visible = True
End If

Above, I also guessed 0 and Null in place of "".

I've tried replacing above with - Me.TermsLabel.Visible = IIf(Me.Terms
= Null, False, True)

Any ideas would be very welcome.

Thanks again,

Michele
 
Hi Michele,

If the field truly is null, you need to use IsNull, rather than testing for
= Null, since Null is not equal to anything, ever.

Try:
Me.TermsLabel.Visible = Not IsNull(Me.Terms)

HTH,

Rob
 
Hi Michele,

If the field truly is null, you need to use IsNull, rather than testing for
= Null, since Null is not equal to anything, ever.

Try:
Me.TermsLabel.Visible = Not IsNull(Me.Terms)

HTH,

Rob

Yeah! Thanks so much.

Now, after working all day what I thought was a great invoice, I've
run into a big problem that I've been struggling with for hours. I'll
make a separate post and hope that you or someone can help. Thanks
again.
 
Back
Top