How to calculate 3 fields of one record in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can somebody help me how to calculate various fields (for Eg. I want to
calculate the total of Basic Salary, Transport, Accommodation etc.. and put
it in another field as the Grand Total) in one record in a form and put the
total in another field of the same record.
 
Standard advice is not to store the total. If you can calculate it
easily then calculate it all the time. The reason is that if you make a
change to the items then the total will be off the minute you forget to
redo the calculation and store the new total. Or if you edit the total,
then the components must be updated - and which one (or ones) should be
updated.

As far as the calculation, if any of the components are blank (null),
then you need to force them to zero for the calculation.

Nz(Salary,0) + Nz(Transport,0) + Nz(Accomodations,0)

Nz replaces a null value with zero for the purpose of the calculation.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top