Results 1 to 4 of 4
  1. #1
    Budatlitho is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2016
    Posts
    44

    Subtotal by page- get a running total for each page, in the Page Footer


    Hello:

    I want to take an existing report and add a running total by page. The field name is Amount, and in the report footer I have
    Code:
    =Sum([Amount])
    I also need a total by page in the page footer. Is this possible? I tried to add
    Code:
    =Sum([Amount])
    to the page footer, but that does not work.

    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Review
    https://www.access-programmers.co.uk...-footer.56654/
    https://microsoft.public.access.repo...ti-page-report

    For a page count or sum, here is example code behind my report:
    Code:
    Option Compare Database
    Option Explicit
    
    Public intPageCount As Integer
    Public intPageTotal As Integer
    
    
    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
        'increment counters for each record printed
        intPageCount = intPageCount + 1
        intPageTotal = intPageTotal + Nz(Me!Qty, 0)
    End Sub
    
    
    Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
        'set textboxes in footer
        Me.tbxPageCount = intPageCount
        Me.tbxPageTotal = intPageTotal
        'reset counters
        intPageCount = 0
        intPageTotal = 0
    End Sub
    Last edited by June7; 02-13-2025 at 02:16 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Budatlitho is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2016
    Posts
    44
    I used the instructions in https://www.access-programmers.co.uk...-footer.56654/
    Tried VB, but was unsuccessful getting it to work. The uk link shows how to accomplish this by adding two fields-- no VB
    THANKS for the link!!!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    And to clarify (I should have in earlier post), for running total just:

    Textbox in detail section with properties set to calc RunningSum OverAll on Amount field.

    Textbox in Page footer that references the other textbox.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-07-2021, 09:10 AM
  2. Replies: 2
    Last Post: 11-09-2016, 10:42 AM
  3. Force Report Footer to before Page Footer
    By Charles CL in forum Reports
    Replies: 15
    Last Post: 01-21-2016, 12:06 PM
  4. Replies: 2
    Last Post: 12-21-2013, 02:09 PM
  5. Replies: 2
    Last Post: 10-15-2013, 09:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums