Sum Problem

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

Guest

I have a form that I input invoices into. I can have up to five amounts on
one invoice and then I have an inoivce total where I am trying to make an
equaition so it will add amounts 1-5 together. I was able to do this before
but I can'y make it work now, it just says error. Also when I look at this in
my table it doesn't seem to be pulling that total amount over is there
something special I need for that to happen as well?
 
You could create a query from your table - insert the invoice number and the
amounts. Click the totals button this will give you a total for each
invoice.
Insert this amount on to the form
 
I have a form that I input invoices into. I can have up to five amounts on
one invoice and then I have an inoivce total where I am trying to make an
equaition so it will add amounts 1-5 together. I was able to do this before
but I can'y make it work now, it just says error. Also when I look at this in
my table it doesn't seem to be pulling that total amount over is there
something special I need for that to happen as well?

Do you have five amounts as five FIELDS in a table? What is the
structure of your table (remember - you can see it, we cannot)?
And what have you tried, and what error are you getting?

Please give us a little help here. We'll be glad to try to diagnose
your condition, but saying "Doctor, I don't feel good, what should I
take" isn't good medical practice!

John W. Vinson[MVP]
 
So there is not a way I can make it total on my form? I am only wondering so
as I am entering the amounts off the one invoice plus the tax I can make sure
everything totals correctly. I was able to do it before but for some reason I
can't get it to work this time and I could never seem to get that total
amount to show in my table.
 
Yes, I have 5 amount fields in my table and 1 tax amount field and then a
total invoice field. I would like that total invoice field to add together
all of my amount and tax fields in my form to get a total and I would like
that total to show in my table. On my form, where I am trying to put the
equation is showing an #Error and when I look in my table it is just showing
$0.00. Let me know if you need anymore info. Thanks
 
Yes, I have 5 amount fields in my table and 1 tax amount field and then a
total invoice field. I would like that total invoice field to add together
all of my amount and tax fields in my form to get a total and I would like
that total to show in my table. On my form, where I am trying to put the
equation is showing an #Error and when I look in my table it is just showing
$0.00. Let me know if you need anymore info. Thanks

Then the equation is wrong.

I'll try to help you fix it if you would be kind enough to let me see
it.



John W. Vinson[MVP]
 
This is what I have in a field of my form under detail:

=[Amount 1]+[Amount 2]+[Amount 3]+[Amount 4]+[Amount 5]+[Tax]
 
This is what I have in a field of my form under detail:

=[Amount 1]+[Amount 2]+[Amount 3]+[Amount 4]+[Amount 5]+[Tax]

"John Vinson" wrote:

Are all of these fields numeric? #Err suggests that one or more of
them contains text. And are any of them NULL? Are they all in fact in
the Form's Recordsource query?

Note that this sum will not be, and SHOULD not be, stored in your
table. Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.


John W. Vinson[MVP]
 
Back
Top