IIF and Sum

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

Guest

I am having trouble making the IIF stetment work with a
Sum on a report.

In a textbox I have this for a control source...
Sum(([TVisit]*[tax1]*0.01)+([TVisit]))

TVisit and Tax1 are controls in the reports detail.

When there are no records (null) in these controls, the
textbox displays '#Error' I want it to display '0'

I tried this...
=IIf(IsError(Sum(([TVisit]*[tax1]*0.01)+([TVisit]))),0,(Sum
(([TVisit]*[tax1]*0.01)+([TVisit]))))

But I still do not get a zero to display.

Tom
 
Can I assume that if the TVisit is null, that the tax will
also be null? If so,...

IIf(IsNull([TVisit]),0,Sum(([TVisit]*[tax1]*0.01)+([TVisit])
))

If you do need to test both, you will need to add the second
IsNull check and decide if you are checking for AND or OR.
--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
Back
Top