If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Return null (blank) instead of zero
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? |
#2
|
|||
|
|||
Return null (blank) instead of zero
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(AB,A*B,A) Then it now becomes IIF( IIF(AB,A*B,A)=0 ,Null, IIF(AB,A*B,A)) -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. "Eastharbour" wrote in message ... 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? |
#3
|
|||
|
|||
Return null (blank) instead of zero
Adding the variable Null was the solution I needed.
Thanks for your help, Dawn "John Spencer" wrote: 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(AB,A*B,A) Then it now becomes IIF( IIF(AB,A*B,A)=0 ,Null, IIF(AB,A*B,A)) -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. "Eastharbour" wrote in message ... 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? |
Thread Tools | |
Display Modes | |
|
|