Function

  • Thread starter Thread starter Eric Cole
  • Start date Start date
E

Eric Cole

I want to design a function that is ba;sically the
opposite of Nz(). I want a field in a report to appear
blank if it has the value 0.
Any ideas?
By the way, is it possible to get hold of the programming
code in VB for the built in Access functions such as Nz?
 
I want to design a function that is ba;sically the
opposite of Nz(). I want a field in a report to appear
blank if it has the value 0.
Any ideas?

Two ways:

- Use the IIF function:

IIF([field] = 0, NULL, [field])

- better, set the Format property of the field. A number field will
accept a Format string consisting of four format expressions separated
by semicolons, for positive, negative, zero and Null values
respectively; so

#;-#;"";"Not Defined"

will display zero as an empty string and NULL as "Not Defined".
By the way, is it possible to get hold of the programming
code in VB for the built in Access functions such as Nz?

No. They weren't written in VBA for one thing, and it's proprietary
Microsoft code for another (I don't know whether something like NZ
would have been written in C or Assembler - probably the latter and
probably fifteen years ago!)
 
Thanks for your response
-----Original Message-----
I want to design a function that is ba;sically the
opposite of Nz(). I want a field in a report to appear
blank if it has the value 0.
Any ideas?

Two ways:

- Use the IIF function:

IIF([field] = 0, NULL, [field])

- better, set the Format property of the field. A number field will
accept a Format string consisting of four format expressions separated
by semicolons, for positive, negative, zero and Null values
respectively; so

#;-#;"";"Not Defined"

will display zero as an empty string and NULL as "Not Defined".
By the way, is it possible to get hold of the programming
code in VB for the built in Access functions such as Nz?

No. They weren't written in VBA for one thing, and it's proprietary
Microsoft code for another (I don't know whether something like NZ
would have been written in C or Assembler - probably the latter and
probably fifteen years ago!)


.
 

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

Back
Top