NZ function problem (1 Viewer)

M

Maloo

Guest
Here is the background -- I have a form that has a calculated field called Total%complete which is calculating from two hidden fields on the form (one field for Total Percent and one field for Total Count). The formula in the Total%Complete field (the control value) is =[Total Percent]/[Total Count].

Here is the problem -- When there are no values in the individual percent complete fields, #Num appears in the Total%Complete field. I know that I need to use the Nz function, but can't get the syntax straight. I have tried numerous ways using the examples in Help, but nothing works.

Would someone out there please write tell me where I should put the Nz function and what the syntax is using the fields I listed above?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:24
Joined
Feb 19, 2002
Messages
43,374
The Nz() function may not solve your problem here. You need to prevent the division operation from happening when the divisor is zero or null. Try this:

=IIf(Nz([Total Count],0) = 0,0,[Total Percent]/[Total Count])
 
M

Maloo

Guest
Thank you so much. It worked perfectly.
 

Users who are viewing this thread

Top Bottom