Making #ERROR# Return 0 (Zero) (1 Viewer)

brian0721

Registered User.
Local time
Today, 09:53
Joined
Dec 5, 2001
Messages
103
In a form, I am pulling a number from a query. However, not everybody is in the query if they do not close a loan. Instead of 0 (zero) it returns #ERROR#. How would I make this reutrn zero instead?

thanks
 

ghudson

Registered User.
Local time
Today, 04:53
Joined
Jun 8, 2002
Messages
6,194
This should get you close to what you want...

If(IsNull([Field1]), 0, [Field1])
 

brian0721

Registered User.
Local time
Today, 09:53
Joined
Dec 5, 2001
Messages
103
ghudson said:
This should get you close to what you want...

If(IsNull([Field1]), 0, [Field1])

Where would I put that?
 

RichO

Registered Yoozer
Local time
Today, 03:53
Joined
Jan 14, 2004
Messages
1,036
I Believe ghudson's reply meant to say IIf as opposed to If.

If your form has a query as its record source you can put this in the query as an expression in the field box, ie: Expr1: IIf(IsNull([Field]), 0, [Field])

You can also use Expr1: Nz([Field]). If should give you the same result.
 
Last edited:

Users who are viewing this thread

Top Bottom