[AccessD] Nz() etc.

max.wanadoo at gmail.com max.wanadoo at gmail.com
Tue Sep 25 10:13:58 CDT 2007


The function is nz(var1,default if null),
Ie: dim str as string
Str = nz(str,"hello")

Or dim var1 as variant, var2 as variant
Var2 = 0
Var1=nz(var1,var2)
Will result in var1 being zero if it is null
It is the same as:
If isnull(var1) then var1 = var2

Parm2 will not take on a value, it is the default value that you feed in for
when your variable is null.

But you propably know that?  So what is the varType of parm1,parm2?
Max
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Tuesday, September 25, 2007 3:59 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Nz() etc.

I've got a form that opens when you click a button. Two of the columns are
calculated. They use Nz(parm1, parm2) and I would think that this results in
zeros in both cases when I am adding new rows, but instead they both come up
with #error, which is unbeautiful. What am I doing wrong?

TIA,
Arthur
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list