Summation Error

  • Thread starter qkimchi via AccessMonster.com
  • Start date
Q

qkimchi via AccessMonster.com

Please help.
I have 7 values entered by user using a form. I want to add those values
that are displayed as a total in a report. Here is my code:
=sum(Nz([queryname]![value1],0)
+Nz([queryname]![value3],0)
+Nz([queryname]![value4],0)
+Nz([queryname]![value5],0)
+Nz([queryname]![value6],0)
+Nz([queryname]![value7],0)
+Nz([queryname]![value2],0))

It works if I only have 6 values but if I have more than 6 values it gives me
an error. My report doesn't run.
Thank you.
 
Q

qkimchi via AccessMonster.com

I changed it to table name but still. It only takes one more value. I need
to add more.
Thank you very much.

Duane said:
Is there a reason why you have the queryname in the expression?
Please help.
I have 7 values entered by user using a form. I want to add those values
[quoted text clipped - 11 lines]
an error. My report doesn't run.
Thank you.
 
D

Duane Hookom

I would not expect that you would need any table or query name:
=sum(Nz([value1],0)+Nz([value3],0)+Nz([value4],0)+Nz([value5],0)
+Nz([value6],0)+Nz([value7],0)+Nz([value2],0))

Adding values across sometimes suggests un-normalized tables.
--
Duane Hookom
MS Access MVP
--

qkimchi via AccessMonster.com said:
I changed it to table name but still. It only takes one more value. I
need
to add more.
Thank you very much.

Duane said:
Is there a reason why you have the queryname in the expression?
Please help.
I have 7 values entered by user using a form. I want to add those
values
[quoted text clipped - 11 lines]
an error. My report doesn't run.
Thank you.
 
Q

qkimchi via AccessMonster.com

Yepeee!! It works!! Thank you so much..

Duane said:
I would not expect that you would need any table or query name:
=sum(Nz([value1],0)+Nz([value3],0)+Nz([value4],0)+Nz([value5],0)
+Nz([value6],0)+Nz([value7],0)+Nz([value2],0))

Adding values across sometimes suggests un-normalized tables.
I changed it to table name but still. It only takes one more value. I
need
[quoted text clipped - 9 lines]
 

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

Top