null values in querys?

G

GregB

I know its (Nz(field)) in VBA but what is the correct syntax for specifiying
a null value in a query?

For my example I need to specify IF the value is null to update it with info.


Thanks!
 
J

John W. Vinson

I know its (Nz(field)) in VBA but what is the correct syntax for specifiying
a null value in a query?

Actually it isn't. NZ() is a function which will *convert* a NULL value to
something else. The VBA function to *ascertain* whether or not a variable is
NULL is

IsNull()
For my example I need to specify IF the value is null to update it with info.

A query criterion of

IS NULL

will do the trick. Note that = NULL or <> NULL or any other comparison
operator with NULL will return NULL as a result (and not retrieve the record);
the only valid criteria are IS NULL or IS NOT NULL.

John W. Vinson [MVP]
 
Top