Sum on Subform

rube

Registered User.
Local time
Today, 18:15
Joined
Jun 21, 2003
Messages
76
I am running into a problem returning a 0 when there are no subform records. I usually use a hidden total text box at the bottom of the subform, and just pull this to the main form. When there are no records I get an Error#.

I have tried to use..

=Nz(Sum([Log]))

=IIF(IsNull(Sum([Log]),0,Sum([Log])

....Sum([Log]) is null,...

All which did not work, I finally had to write a function on the main form that when it errored out, would send back a 0 to the Main Form Text Box.

Is there a better way to do this, or does anyone know what I am doing wrong with Nz/IIF?

Thanks for any input.
 
=Iif( IsNumeric(Forms!Mainform!SubForm.Control),Forms!Mainform!SubForm.Control,0)
 
Error#

Rich, thanks much! Worked like a charm.


Thanks again...
 

Users who are viewing this thread

Back
Top Bottom