Calculate totals in a field

JGC

New member
Local time
Today, 10:18
Joined
Jun 21, 2002
Messages
7
I have 4 fields in my table and form (Towing Charges) (Storage Charges) (Other Charges) and (Total Charges). I need to have Towing Charges, Storage Charges & Other Charges to calculate and populate in my Total Charges field. I tried a script in the control source of the field, but its not working. I probably have the script wrong.

Thanks Everbody
 
Generally as a rule you wouldn't do this, though there is the occasional exception but it is very occasional.

It is a matter of saving space vs creating a mathematical equation.

In your table do not save the total that you want. Make up a query and in the query add a field with the mathematical equation to give you the total. You can then use this query as your datasource for your forms or reports. Meanwhile if you have a thousand records you have just made the database size smaller by not saving the total.
 
DES is right. Tables are for storing data, queries for calculations and forms for viewing data (generally speaking).

Base your form on a query, add a calculated field in your query like this:
TotalCharge:[Towing Charges]+[Storage Charges]+[Other Charges]
You can add the TotalCharge field to the form just like all the rest.

By the way, get in the habit of naming your fields without spaces and without any punctuation other than the underscore. So instead of Towing Charges use TowingCharges or Towing_Charges
 
Thank You very much for the help.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom