Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Boston, Massachusetts, USA
    Posts
    205
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide group footer (Access 2002 SP 2)

    I am not very Access savvy, and I have a user that has a question I am not able to answer. I am hoping that someone else can help me out! He has some new reports for which he would like to find a way to hide a group footer if the there is only one record/detail line. Does anyone have any ideas? I can find out more information if needed. Thanks!

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

    Re: Hide group footer (Access 2002 SP 2)

    Let him put a text box in the group footer, named txtCount, with control source =Count(*), and Visible set to No.
    Next, let him create an On Format event procedure for the group footer section. It would look like this:

    Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
    Me.GroupFooter1.Visible = (Me.txtCount > 1)
    End Sub

    GroupFooter1 must be replaced by the name of the group footer that should be hidden.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide group footer (Access 2002 SP 2)

    Hans
    Came across this message while trying to resolve a problem I have.

    The data for my report is CodeType, InvoiceNo, InvoiceDate and Quantity

    I have a report in which I don't show anything in the Detail section (if I did show data it would be the invoicedate and quantity), an InvoiceNo footer with sub totals and then a CodeType footer with subtotals.

    I want to only show the CodeType footer if there is more than one line in the InvoiceNo footer.

    I tried simply placing the =count(*) in the InvoiceNo footer, but unsuccessful.

    Any thoughts on what I need to do to achieve this

    John

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

    Re: Hide group footer (Access 2002 SP 2)

    Put a text box named txtCount in the InvoiceNo footer.
    Set its Control Source property to =1
    Set its Running Sum property to Over Groups
    Set its Visible property to No.

    Put the following code in the On Format event of the group footer for CodeType:

    Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
    Me.GroupFooter1.Visible = (Me.txtCount > 1)
    End Sub

    Replace GroupFooter1 with the correct name of the CodeType footer.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide group footer (Access 2002 SP 2)

    Many thanks - easy when you know how - or at least sit back from the problem a little and think logically

Posting Permissions

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