Solved

Grand Total based on calculated sub-group field

Posted on 2013-01-08
10
1,025 Views
Last Modified: 2013-01-08
I have a MS Access Database that track products through 3 different departments.  The report that I have groups items by Item, then by Department then by Operator. I have a calculated subgroup fields (in the department footer) that takes the 1. [SumOfQty] / [SumOfTime] and 2.  [SumOfLaborCost] / [SumOfQty]

Now I want to get a grand total of these calculated fields in the Item Footer. But everytime that I try and reference the calculated field and run the report, it pops up asking for the parameter to be entered.

I have added two files to help explain.

How can I add the sub-groups total lines to a Grand total when they are a calculated field?
Rpt-Problem---Print-Preview.jpg
Rpt-Problem---Report-Design.jpg
0
Comment
Question by:dsheridan
  • 6
  • 4
10 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38755786
If I am understanding correctly, ...If it were me, I would do your two calculations in the Reports recordsource, then you could just bring these in as fields( ex: SumOfQtySumOfTime), then you get any summary you wanted  with something like this as a textbox control source:
=Sum([SumOfQtySumOfTime])

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38755815
something like this:
Database171.mdb
0
 

Author Comment

by:dsheridan
ID: 38755879
Let me see if I can clairify so more. I'm getting all the calculations except when I try and add the calculated field into the item footer for CostPerPeice.  I cannot just do a total sum because it would count all depts several times

Looking at your example I have made some modifications so you can see.  
In the new example, let say you cannot simple add all depts as a total so you calculate the subgroup then sum that calculated field. Open the report in design and /or try and run the report.
Database171.mdb
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38755986
< I cannot just do a total sum because it would count all depts several times>
Not sure I follow...
In my sample, it counts and sums each group only once...

Based on my sample post a clear graphical representation of the *exact* output you are looking for here (based on the exact numbers in my sample)
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 38756050
Something like this perhaps:
Database171-1-.mdb
0
 

Author Comment

by:dsheridan
ID: 38756254
Great (screen shot to show how it works.
0
 

Author Closing Comment

by:dsheridan
ID: 38756256
Excellent. Problem solved.  I didn’t even think (or know) about the “running sum” function under the properties data tab.

Here’s what I did to fix problem with the help from “boag2000”.

Copied the calculated field into the same group footer and then made the Visible = “No” with a name of the field called “txtSumCPP”.  Then in the Item footer group I made the control source of the total field equal to “=[txtSumCPP]”.  The reason that you need to make a second item is it will keep the running sum in each group footer and would not know what the total for that group was.  I have a screen shot attached to show that it works correctly.

Thank you so much for your help.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38756428
No problem
;-)

Sorry I misinterpreted your original request
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38756761
dsheridan,

And congratulation on investigating the sample extensively on your own to find the "Running Sum" property...
Typically most people will just say "How'd you do that?"

...and you repaired your own report without any direct help form me.

Congratulations, Great work!
;-)

JeffCoachman
0
 

Author Comment

by:dsheridan
ID: 38757393
just neede a nudge in the right direction. Thanks again..;-)
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question