Data Type: String or Numeric
Any numeric expression or a string representation of a numeric value.
expression converted to a type of
expression as aa Boolean
type. Expressions that evaluate to 0 are converted to
False (0), and expressions that evaluate
to nonzero values are converted to
If the expression to be converted is a string, the string must
act as a number. Therefore,
CBool("ONE") results in a type mismatch
CBool("1") converts to
You can check the validity of the expression prior to using the CBool function by using the IsNumeric function.
When you convert an expression to a Boolean, an expression
that evaluates to 0 is converted to
False (0), and any nonzero number is
Therefore, a Boolean
can be converted back to its original value (i.e., 0), but the
original value of the
expression can’t be restored unless it was originally -1.