• Hide group footer (Access 2002 SP 2)

    Author
    Topic
    #405344

    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!

    Viewing 1 reply thread
    Author
    Replies
    • #832020

      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.

      • #975834

        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

        • #975838

          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.

          • #975840

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

    • #832021

      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.

    Viewing 1 reply thread
    Reply To: Reply #975838 in Hide group footer (Access 2002 SP 2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel