NZ function problem

  • Thread starter Thread starter Maloo
  • Start date Start date
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?
 
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])
 
Thank you so much. It worked perfectly.
 

Users who are viewing this thread

Back
Top Bottom