IIf and sum

C

Chris

Hello,

In my database I have a continuous form that I use for price calculation. In
a combobox I choose an article number so several data are displayed
afterwards (price, volume, ..). In an unbouded text label I have to fill in
the number of that article needed. So at the end I get a list of articles
composing my product.
For each article there is also a product code (R, V, P) that determines the
VAT percentage. In each "row" of my form I have three text fields (depending
of the product code) in which I calculate the result of article price*number
of articles. I use the following code:
"=IIf([letter]="R";[number1]*[price1];"0")". This works fine but when I try
to get a sum of all the results in the R-column I always get a #Name error.
I tried with =Sum([result1]) and several others but it won't work.

Could someone help me out here?

Thanks

Chris
 
F

Fredg

Chris,
Repeat the entire calculation:

=Sum(IIf([letter]="R";[number1]*[price1];0))

Note: there are no quotes around the zero. It's a number not text.
 

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

Similar Threads

Sum(iif(...)) Help 8
Problems with a Sum controlsource, please help. 12
Sum If function in textbox 0
Sum Calculated Field Question 1
Access Query problem 1
Printing iif results in a report 3
IIF in subform 3
using sum and iif 1

Top