IsEmpty Function |
No
IsEmpty(varname)
varname
Use: Required
Data Type: Variant
A numeric or string expression.
Boolean (True or False).
Determines if the variable has been initialized by having an initial value (other than Empty) assigned to it.
If the variant passed to IsEmpty has been initialized, True is returned; otherwise, IsEmpty returns False.
IsEmpty works only with variants. You shouldn't use it with the primitive data types (such as Integer, String, etc.) because these data types are automatically initialized with default values and therefore are never empty.
Although IsEmpty can take an expression as the value of varname, it always returns False if more than one variable is used in the expression. IsEmpty is therefore most commonly used with single variables.
When dealing with uninitialized object variables, if a reference to an object variable has not been successfully set, the variable has a value of Nothing. However, to determine if an object variable has been set successfully, you must use the syntax:
If objvar is Nothing Then ... End If