In Access, the IsNull function returns a boolean value that indicates whether or not an expression contains no valid data (Null).
The syntax for the IsNull function is:
IsNull ( expression )
In Access, the expression argument can be any numeric or string expression. The IsNull function returns True (-1) if the expression contains the Null value; otherwise, it returns False (0). Null is not the same as a zero-length string, which is often referred to as a null string.
Important: Using the IsNull function is the only way from within Access to determine whether or not an expression contains a null value.
Example
|
VBA Code
|
This example uses the IsNull function to determine if a variable contains a Null. Now the MyResult variable would contain FALSE as a value.
SQL query
You can also use the IsNull function in a query.
|