> Hi Guys,
>
[quoted text clipped - 3 lines]
>
> This happens if the field discount has a value of 0
In math, what is the result of Zero divided by 3?
Zero.
What is the result of 3 divided by zero?
You cannot divide a number by 0, so you received an error when
[discount1] is null ... Nz([Discount1],0).
Test for 0 before doing the calculation.
Margin:IIf(Nz([Discount1],0) = 0 , Null,Nz([gp],0)/[Discount1]/100)
You'll get 0 if [gp] is null and [Discount1] has a value, an empty
field (Null) if [Discount1] is null, or the result of
[gp]/[Discount1]/100 if both fields have a value other than zero.

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail