how & where do I auto sum in a table for invoice total

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

Guest

I would like the table to hold the invoice total but I can't figure out how
(the actual equation) or where to put it so that it auto sums the individual
items and puts the totals in.
 
I would like the table to hold the invoice total but I can't figure out how
(the actual equation) or where to put it so that it auto sums the individual
items and puts the totals in.

That's an easy one.
You DON'T!

Access is not a spreadsheet and has it's own rules of usage.

Do not store calculated data.
Whenever you need the results of a calculation, calculate it.

Store the various data that make up the total, i.e. [Price],
[Shipping], and [SalesTaxRate]

Then, in a form or report, calculate it in an unbound control.
Set the control's Control Source to:
=(Nz([ItemPrice]) + Nz([Shipping])) * [SalesTaxRate]

In a query it would be:
Total:(Nz([ItemPrice]) + Nz([Shipping])) * [SalesTaxRate]

Note: Look up the Nz() function in VBA help.
 
Back
Top