Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Grand Total based on calculated sub-group field

Posted on 2013-01-08
10
Medium Priority
?
1,035 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

715 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