Null

This keyword/value can only be used in conjunction with the Variant data type.
This keyword/value is used when a variable declared as variant does not contain any valid data.
This data type can be thought of as defining an unknown value.
This keyword cannot be assigned to variables of other data types.
The Null data type can be assigned explicitly to indicate that the variable has no data.
A Null value is normally used to indicate an invalid value or error.
The Null data type can only be assigned explicitly.


IsNull Function

You can test a variable for a null value using the ISNULL
This function return True or False indicating if a variable (or expression) does not contain any data.

You cannot use "myVariant = Null" to test for a null value


Null Values in a Expression

If any of the values in an expression have been assigned the value Null then the result will also be Null.


vbVarType.vbNull

This cannot be used to assign a Null Value.
If you assign a variable to vbNull you are actually assigning a value of 1 or "1".


Important

If you assign a Null value to a variable of a different data type you will generate a run-time error "Invalid use of Null".


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext