Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Thanked 0 Times in 0 Posts

    reports-make label invisible (2002/SP2)

    How can I turn a label for a text field invisible if the related text field contains no data. I would like both the text field and the label field to just disappear on the report if there is no data and if possible not leave a blank space on the report.



  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: reports-make label invisible (2002/SP2)

    Do the following:
    <UL><LI>Set the Can Shrink property of the Detail section of the report to Yes.
    <LI>Set the Can Shrink property of the text box to Yes.
    <LI>Remove superfluous vertical space between the text box and other controls, but make sure that there is no overlap between the text box and other controls (except for the label belonging to the text box).
    <LI>Create the following code for the On Format event of the Detail section. Replace txtField and lblField by the name of the text box and its label.

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.[lblField].Visible = Not IsNull(Me.[txtField])
    End Sub[/list]HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts