Results 1 to 10 of 10
  1. #1
    yayanpuji is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    8

    how to add the amount of a column (sum) per page in access

    I have a problem when trying to add some sums in every page of my report. The default "Total" menu in Design tab, is only adding total sum in the end of the report, there is no option to add it in every page.

    I have looked at "Placing sums in header/footer report" in http://office.microsoft.com/en-001/a...001122444.aspx,
    but still did not understand the code txtPageSum = txtPageSum + ExtendedPrice, txtPageQuantity = txtPageQuantity + Quantity means in referring to the "extendedPrice" and "quantity".
    Anyone could help me with this VBA-solving in Placing sums in footer report? Or does anybody have the other easier alternative?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    txtPageSum and txtPageQuantity are names of textboxes on the report. ExtendedPrice and Quantity are fields from the report RecordSource query. Modify references as appropriate for your db. I very much doubt there is any alternative method.
    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
    yayanpuji is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    8
    Quote Originally Posted by June7 View Post
    txtPageSum and txtPageQuantity are names of textboxes on the report. ExtendedPrice and Quantity are fields from the report RecordSource query. Modify references as appropriate for your db. I very much doubt there is any alternative method.
    Click image for larger version. 

Name:	sums.png 
Views:	12 
Size:	69.8 KB 
ID:	13636
    please see my work. I would like to place sum in footer. There is the unbound textbox supposedly summing all the "Jumlah". What is the appropriate VB coding?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Don't understand your confusion. Setup looks correct. Replace the field names in the code with your field names. Replace textbox names. Modify the code for as many 'sums' as you want.

    If you have modified code and it errors, what is the error? Post your attempted code for analysis.
    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.

  5. #5
    yayanpuji is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    8
    Quote Originally Posted by June7 View Post
    Don't understand your confusion. Setup looks correct. Replace the field names in the code with your field names. Replace textbox names. Modify the code for as many 'sums' as you want.

    If you have modified code and it errors, what is the error? Post your attempted code for analysis.
    I have modified the code as it is shown in this attachment:
    Click image for larger version. 

Name:	vb.png 
Views:	10 
Size:	66.6 KB 
ID:	13640

    but when i print previewed, the sum "Jumlah" is not in the footer.
    Click image for larger version. 

Name:	prin preview.png 
Views:	8 
Size:	95.3 KB 
ID:	13641
    Is there anything I missed?

  6. #6
    yayanpuji is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    8
    here is my db, the report is in the "coba_Query" Report. There is no confidential data, so I didn't edit anything.
    please fix the print sum footer "Jumlah" section in the Unbound textbox.
    Attached Files Attached Files

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Must run report in PrintPreview or direct to printer. ReportView will not work.
    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.

  8. #8
    yayanpuji is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    8
    Have done what you said. Still no result.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The page and report footer sums all show for me.

    The textbox isn't wide enough to display the full value of Jumlah sum in the report footer.

    Select all the controls on the report, right click > Layout > Remove. Now you can move and resize each control independently.
    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.

  10. #10
    yayanpuji is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    8
    Thank you.Turns out the problem is on the"Security Warning" (Certain content in the database has been disabled), that needs to be click "Options..." and "Enable this content".The VB is deemed as a security warning. And when this notification is cleared, then the VB can work well.

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

Similar Threads

  1. splitting an amount
    By mohiahmed in forum Access
    Replies: 1
    Last Post: 07-15-2013, 04:39 PM
  2. Replies: 1
    Last Post: 03-05-2013, 06:38 PM
  3. Replies: 2
    Last Post: 11-21-2012, 09:57 AM
  4. Multiple-column page totals
    By SteveF in forum Reports
    Replies: 4
    Last Post: 04-24-2012, 09:31 AM
  5. Amount in word in MS. Access 2000 (VBA)
    By dannygan in forum Access
    Replies: 5
    Last Post: 06-07-2009, 11:52 PM

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