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
Solved

Grand Total based on calculated sub-group field

Posted on 2013-01-08
10
1,026 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
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…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

828 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