Results 1 to 3 of 3
  1. #1
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    163

    Programming Totals by group in a report.

    I have a report listing Products, grouped by color, with a Total Weight field for all the products which belong to the said color group. Everything is working fine, but I decided to start using vba to pull values from the Totals field and do very fundamental math. In the photo below you can clearly see my dilemma:
    Click image for larger version. 

Name:	Report1.jpg 
Views:	6 
Size:	184.7 KB 
ID:	18797
    The very last color Group (in this case, it's Biscuit), everything goes swimmingly: the total weight is multiplied by 10. However, each other color group inherits the final color groups "Total weight X 10". here is the Code that makes this happen:
    Click image for larger version. 

Name:	Report2.jpg 
Views:	6 
Size:	272.8 KB 
ID:	18798

    I'm doing much more advanced code at the form level, but this is my very first day playing with Reports, so I'm a bit confused. Any help much appreciated. Matt

  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,632
    Can't use the load event for this. Load event runs only once therefore the same value will show for all records.

    Why use VBA? This is unnecessary complication and can make reports slower. Put the calc in 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.

  3. #3
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    163
    My ignorance knows no bounds. I have written hundreds of lines of vba for my project, but this is the first time I've used the expression builder. It worked! thank you June.

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

Similar Threads

  1. Sorting on group totals
    By KMac in forum Reports
    Replies: 3
    Last Post: 10-16-2014, 02:33 PM
  2. Group on a totals field
    By dharsh in forum Access
    Replies: 14
    Last Post: 07-11-2013, 10:43 AM
  3. Group Totals Based On Values
    By Poida3934 in forum Reports
    Replies: 1
    Last Post: 05-20-2013, 10:12 PM
  4. Replies: 5
    Last Post: 12-06-2011, 11:18 AM
  5. Group Totals in a form
    By mai1081 in forum Forms
    Replies: 1
    Last Post: 05-14-2008, 06:11 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