Results 1 to 4 of 4
  1. #1
    rajudh is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2020
    Posts
    12

    Want to display the Amount total in the Page Footer

    Hello,


    I have created a report which print Invoice Form which Record Source is a query.
    There are 3 Text box that shows sub total. round off and total amount at report footer.
    But if there are one or two items it prints just below that items. I want to print these 3 text boxes at bottom of page.
    If I put them at report footer it shows - "# error". Is there any way to print these 3 Text Box at end of page as in second image ?
    The control source are -
    TxtSubTotal =Sum([Quanity]*[Rate]),
    TxtRoundOff = =[TxtTotal]-[TxtSubTotal],
    TxtTotal = =Round(Sum([Quanity]*[Rate]),0.5)
    I am attaching images for reference

    Thanks.

    Click image for larger version. 

Name:	01.jpg 
Views:	16 
Size:	52.3 KB 
ID:	53143Click image for larger version. 

Name:	02.jpg 
Views:	16 
Size:	53.2 KB 
ID:	53144

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You said you get #Error in Report footer - did you mean Page footer? That would be expected for Page footer.
    These calcs should work in Report footer but will not be at bottom of page. Add controls in Page footer that reference Report footer controls (these can be not visible).
    If you want to provide db for analysis, follow instructions at bottom of my post.

    Is it possible report could be multi-page? Do you want total just for items on each page or do you want total to be cumulative?
    If you want aggregate calc for each page, this requires VBA code.
    Place textboxes in Page footer then code behind report would be like:
    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 intPageCount and intPageTotal 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 the textboxes in footer
        Me.tbxPageCount = intPageCount
        Me.tbxPageTotal = intPageTotal
        'reset our counters
        intPageCount = 0
        intPageTotal = 0
    End Sub
    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
    jojowhite's Avatar
    jojowhite is online now Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    433
    you can also use this on Page footer:
    Code:
    TxtSubTotal
    =DSum("Quantity*Rate", "YourTableName", "InvoiceNo = " & InvoiceNo)
    
    
    TxtTotal
    =Round(DSum("Quantity*Rate", "YourTableName", "InvoiceNo = " & InvoiceNo), 0.5)
    
    
    TxtRoundOff = =[TxtTotal]-[TxtSubTotal],
    

  4. #4
    rajudh is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2020
    Posts
    12
    Thanks JojoWhite

    This solve my problem

    Thank you once again.

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

Similar Threads

  1. Replies: 3
    Last Post: 02-13-2025, 02:23 PM
  2. Replies: 1
    Last Post: 07-07-2021, 09:10 AM
  3. Replies: 2
    Last Post: 11-09-2016, 10:42 AM
  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