Return null (blank) instead of zero

G

Guest

I have written an expression using the IIF function. It evaluates two number
fields and performs a calculation. I would like to display null (blank) if
the expression returns a value of zero. Is this possible?
 
J

John Spencer

If you want it to display blank then you can use the control's format to set
that.

Set the format as follows
#;-#;"",""

If you want it to BE null then you need to do the calculation and test the
result and then either return Null or the value of the calculation
So if your original IIF is
IIF(A<>B,A*B,A)
Then it now becomes
IIF( IIF(A<>B,A*B,A)=0 ,Null, IIF(A<>B,A*B,A))

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top