Doing a sum in a control

deejay_totoro

Registered User.
Local time
Today, 20:33
Joined
May 29, 2003
Messages
169
Hello,

I have placed a control in the form footer of my form. The control does a sum of three fields.

What I have noticed is that if any of the fields does not contain any data (even a zero) the Sum calcuation will not trigger.

However entering even a zero will trigger the sum.

eg:1

fld1 100
fld2
fld3

(Sum([fld1]))+(Sum([fld2]))+(Sum([fld3])) = (nothing shows)

eg:2

fld1 100
fld2
fld3 100

(Sum([fld1]))+(Sum([fld2]))+(Sum([fld3])) = (nothing shows)

eg:3

fld1 100
fld2 0
fld3 100

(Sum([fld1]))+(Sum([fld2]))+(Sum([fld3])) = 200 (sum works)

How can I get the control to sum up the data - even if there isnt anything entered in some of the fields?

Thanks!

dj_T
 
Lookup the Nz() function.

Sum(Nz([Field]))
 

Users who are viewing this thread

Back
Top Bottom