Hiding Labels in Reports if Field Blank

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
 
R

Rob Parker

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
 
M

mjones

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.
 

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

Top