View Full Version : Formula for a running total help


Jester21
06-11-2010, 05:18 AM
Greetings. I am looking for assistance to manage a running total along the bottom of the tables as components are added for a new project. Currently I am trying to get a sum of all "Total Component Costs" in the group but I don't believe my =Sum([Total Component Cost]) is the proper formula and leaves me with a blank on all pages of my table. Any assistance to correct this issue would be much appreciated. Thank you.

jzwp22
06-11-2010, 11:30 AM
Welcome to AWF!

A table only holds raw data. If you want to do totals, that can be done in a query, a form or a report.

In order to help you further, we need to get an understanding of your application and your table structure. Could you please provide those details?

Jester21
06-11-2010, 12:34 PM
Thank you for the welcome.

Basically we have been designing a table for guessing labor and unit parts that works to the point where we can add the labor per unit of a good and the price per unit. this saves the data in a table which can be adjusted at any time by changing item quantity. what we are looking to do is have another cell at the bottom that keeps a running total of all the added costs of EACH item at the bottom. This is the number that we will establish relationships for other tables.

Is this something I should run in a report or is there a way to keep that data on the table and if so how?

Thank you

jzwp22
06-11-2010, 12:42 PM
...do is have another cell at the bottom that keeps a running total of all the added costs of EACH item at the bottom.

A table does not function like a spreadsheet, you cannot have a field ("cell") that holds a total when the rest of the records hold individual values (i.e. not totals). A total is generally not stored in a table at all. It is calculated when you need it (in a query, form or report). This preserves data integrity. If you were to store a total and then change a record that went into calculating the total, the total is not changed automatically and thus the actual total would not agree with the stored value.

Additionally you would not like any table with a total value.

Could you please explain in more detail what you are trying to do and could you please provide your current table structure (table names and field names).

Are you trying to model some kind of manufacturing operation?

PNGBill
06-11-2010, 12:55 PM
Check out and try and use the correct Terms. Most important in the Basic part of Databases.

Tables store the your basic unique data by way of records which are made up of Fields. Your entry in the Telephone book is One Record of Field - FullName, Field - HomeAddress and Field - TelNumber. Simple version...

You have Forms and Reports, that display and manipulate data.

You have Queries that Select and Manipulate data.

Very simple description.

You appear to be talking about Forms but using Table word.

A Form will display your records and show a Total at the bottom.

A Table has no Bottom, just a last record which would depend on the sort order you choose at the time.
To have a Total in a table, apart from being pretty near impossible to setup is like the Population Sign when you approach a town, no sooner then when it was erected it was out of date. As you drive into town, the sign needs to be changed.:eek:

Tables, Forms, Reports, Queries - Just the start:D

Jester21
06-14-2010, 05:08 AM
Thanks for the help guys. I'm going to try to set up a query to work the data. Sorry was away from my computer all weekend but if I have any more questions I'll know where to look. Lets hope I can get this figured out. Access is helpful once you get past the annoying setup part.

jzwp22
06-14-2010, 05:28 AM
Access as all relational databases require some different thinking compared to spreadsheets, so there is a learning curve involved. We're here to help if you need additional assistance.

Jester21
06-14-2010, 06:33 AM
It appears I do have one more issue. On the form tied to the table, I have a few inputs that use mathematical formulas to calculate the cell value. When I save the form to apply to my table I get the hard input values that save but not the formulas. Is there a specific setup I need for this to transfer into my tables or is it the way I have the setup.
For Example: One of my values "Total unit cost" is the 'quantity' which I input times the 'unit price' which is also directly input. when i get the value in the form and save, I check on the table. Only the quantity and unit price have updated but the Total unit cost stays blank. Thanks again

Jester21
06-14-2010, 06:36 AM
I feel silly asking what is probably basic questions, I have always been an Excel user so Access is a bit outside of my comfort zone

jzwp22
06-14-2010, 06:51 AM
It is generally recommended to not store calculated values like your total unit cost in the table. You just store the base data. You can show the calculated total on the fly whenever you need it in forms, queries and reports. As I explained earlier, having a calculated value like a total stored in a table could cause data integrity issues if a base data value is changed.

You might find it helpful to go through a tutorial to help in the transition from spreadsheets to relational databases. This site (http://www.accessmvp.com/strive4peace/) is one of many tutorial sites that are out there.