ProgrammerGuide.Net | Step by Step Programmer Guide

VB-Value

Value,

IsNull
Returns a Boolean value that indicates whether an expression contains no valid data (Null).

Syntax
IsNull(expression)
The required expression argument is a Variant containing a numeric expression or string expression.

Remarks
IsNull returns True if expression is Null; otherwise, IsNull returns False. If expression consists of more than one variable, Null in any constituent variable causes True to be returned for the entire expression

Example:
MyVar = “”
MyCheck = IsNull(MyVar) ‘ Returns False.

MyVar = Null
MyCheck = IsNull(MyVar) ‘ Returns True.

IsEmpty
Returns a Boolean value indicating whether a variable has been initialized.
Syntax
IsEmpty(expression)

The required expression argument is a Variant containing a numeric or string expression. However, because IsEmpty is used to determine if individual variables are initialized, the expression argument is most often a single variable name.
Remarks
IsEmpty returns True if the variable is uninitialized, or is explicitly set to Empty; otherwise, it returns False. False is always returned if expression contains more than one variable. IsEmpty only returns meaningful information for variants.

Example:
MyVar = Null ‘ Assign Null.
MyCheck = IsEmpty(MyVar) ‘ Returns False.

MyVar = Empty ‘ Assign Empty.
MyCheck = IsEmpty(MyVar) ‘ Returns True.

IsNumeric
Returns a Boolean value indicating whether an expression can be evaluated as a number.

Syntax
IsNumeric(expression)
The required expression argument is a Variant containing a numeric expression or string expression.

Remarks
IsNumeric returns True if the entire expression is recognized as a number; otherwise, it returns False. IsNumeric returns False if expression is a date expression.

Example:
MyVar = “459.95” ‘ Assign value.
MyCheck = IsNumeric(MyVar) ‘ Returns True.

MyVar = “45 Help” ‘ Assign value.
MyCheck = IsNumeric(MyVar) ‘ Returns False.

Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?