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.
 

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