How to calculate amount

mithani

Registered User.
Local time
Tomorrow, 05:42
Joined
May 11, 2007
Messages
291
Dear friends,

I have one form and subform. Main form having master detail of invoice and subform in tabular format having item. First I enter invoice, date, supplier, project and then I go to subform to enter the detail of item (item code, unit price and quantity and amount calculate on basis of unit price and quantity).

My problem, I have one field Total amount in main form. I want whenever I entered items in my subform, that field (total amount) should be calculated automatically. Its like sum of amount field. Need your help please.

rgard

mithani
 
Last edited:
total your field on the subform (in the form footer) and refer to that in your total field on your main form.
 
thanks dennisk

could you please give me formula to sum the amount field in subform footer?

thanks

mthani
 
=Sum([YourFieldNamehere])

replace YourFieldNamehere with the name of the field to be totaled
 
Thanks Dennisk & Ansentry,

Its working fine. Tell me when I am writting =sum([field]) at control source of total amount, how can I save the total amount in data table. I mean its like unbound field just using to get the total amount but should be saved in database. any help???

mithani
 
You should not be storing totals in the database since you can recreate the total from the other fields. This is another example of maintaining normalization. That info can be gleaned by queries, if you want it for reports.
 

Users who are viewing this thread

Back
Top Bottom