IIF Statement calculation

D

DrMojo

i have a field in a subform that has
"=IIf([TotalSales]>=[TempField],25,0)" as its control source. the
subform is in Continuous Forms. the question that i have is how would
i go about summing up the total in the subform footer.

any help would be great.
thanks
drmojo
 
J

John Vinson

i have a field in a subform that has
"=IIf([TotalSales]>=[TempField],25,0)" as its control source. the
subform is in Continuous Forms. the question that i have is how would
i go about summing up the total in the subform footer.

Simplest is to base the Subform on a Query with this field as a
calculated field, and sum that fieldname.

Alternatively, use

=Sum(IIf([TotalSales]>=[TempField],25,0))

and be aware that it will call the IIF function twice as many times,
at a cost in performance.
 
Top