Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Dec 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    conditional footer visibility (2002)

    I have a report to print out balance due, one page for each of our 500 members. The detail section of the report shows each person's name & address and their balance due, which can be $0 if they are paid in full or >$0 if they owe us something. The footer is a receipt for them to cut off, fill out and send back if they want to make a payment. I want to prevent the footer from printing if the their balance due = 0. I know the solution must involve setting the visible property of the footer to false when the control containing the balance due =0. I tried that using a macro and Set Value command in the OnFormat property of the footer. It is close to working, but the footer only comes back to visible with a second successive nonzero balance due. Help! Thanks!

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: conditional footer visibility (2002)

    The only solution I know is to set the visible property of each control in the footer to false when the due balance = 0

    Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
    Me.TextBox1.Visible = Me.[Due Balance] <> 0
    Me.TextBox2.Visible = Me.[Due Balance] <> 0
    ...
    End Sub

    Replace [Due Balance] with your due balance field.
    Repeat the line for each control in the footer with the appropriate control name.
    Francois

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: conditional footer visibility (2002)

    Welcome to Woody's Lounge!

    An alternative is to set the visibility of the page footer section in the On Format event of the detail section instead of in the On Format event of the page footer section.

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.PageFooter.Visible = (Me.[Due Balance] > 0)
    End Sub

    Substitute the appropriate names.

  4. #4
    New Lounger
    Join Date
    Dec 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: conditional footer visibility (2002)

    This worked. Thank you very much.

  5. #5
    New Lounger
    Join Date
    Dec 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: conditional footer visibility (2002)

    Didn't quite work. Still ended up with some footers not showing up that should have. Elegant code example though, so I was happy to have learned that. Thank you very much.

Posting Permissions

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