Nz() function

NB! This blog is moved to gunnarpeipman.com

Nz() function is kinky creature is Access VBA. It is called “null to zero” but it hardly has something to do with zeros. For me this function is good shortcut for gangsta rapper street name – NullZ. Well, for me was most confusing the fact that one need to provide this function with null’s replacement value if empty string is not enough for numbers.

After this assigment:


i = Nz(Rs("Size"))

the value of i is empty string. If we want Nz() to return zero, we need to write it this way:


i = Nz(Rs("Size"), 0)

I have to say that Nz() was very memory freshing experience after long time without any VBA code. :)

2 Comments

Comments have been disabled for this content.