Make comments box appear in report

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hello everyone,

I have a report that has a comments field in the Detail
Section if the my report. What I want to accomplish is if
the comments field is blank, do not display the comments
label or the text box. My code only hides the comments
field. What I think I might have to do is loop through
each record and see if the comments field has data (text
data). How do I do this?

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
If IsNull([Reports]![qryTotals By Column]![Comments])
Or IsEmpty([Reports]![qryTotals By Column]![Comments]) Then
Me.Label47.Visible = False
Me.Comments.Visible = False
End If
End Sub
 
You could change the "label" to a "text box" and set its control source to:
="Comments: " + [Comments]
Set the width to only show "Comments: " and don't allow the text box to
grow. If Comments is null then this "label" will be blank.

Trust me.
 
Back
Top