Change Report Layout Programitically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chfran

    Change Report Layout Programitically

    I have a report and I want it to show a label or text box if the data
    on the row is null or = 0.

    I've tried and if..then..else statement in the format event for the
    detail section of my report.

    Any ideas?

    Thanks in advance!

  • King Ron

    #2
    Re: Change Report Layout Programitically

    Ola C: What was IN the if-then-else statetment? You should be able to
    set the .Visible property _OnFormat:

    <uncompiled code>

    Private Sub Detail_OnFormat
    If ((IsNull(Me.myT extBox)) Or (Me.myTextBox = 0)) Then
    Me.myTextBox.Vi sible = False
    Me.myTextBoxLab el.Visible = False
    Else
    Me.myTextBox.Vi sible = True
    Me.myTextBoxLab el.Visible = True
    End If
    End Sub

    </uncompiled code>

    King Ron of Chi

    Comment

    • fredg

      #3
      Re: Change Report Layout Programitically

      On 2 Mar 2005 07:56:57 -0800, chfran wrote:
      [color=blue]
      > I have a report and I want it to show a label or text box if the data
      > on the row is null or = 0.
      >
      > I've tried and if..then..else statement in the format event for the
      > detail section of my report.
      >
      > Any ideas?
      >
      > Thanks in advance![/color]

      Try this in the Report Detail Format event:

      [ControlName].Visible = IsNull([SomeField]) or [SomeField] = 0

      i would strongly suggest, the next time you write some code and it
      doesn't work, that you post the actual code. We are not mind readers.
      --
      Fred
      Please only reply to this newsgroup.
      I do not reply to personal email.

      Comment

      • chfran

        #4
        Re: Change Report Layout Programitically

        Thank you...

        I had something similar but didn't see that I could use the .visible on
        a label in a report.

        I'm pretty sure this will work.

        Thanks!

        Comment

        Working...