totn Access Functions

MS Access: CBool Function

This MSAccess tutorial explains how to use the Access CBool function with syntax and examples.

Description

The Microsoft Access CBool function converts a value to a boolean.

Syntax

The syntax for the CBool function in MS Access is:

CBool( expression )

Parameters or Arguments

expression
The value to convert to a boolean.

Returns

The CBool function returns a boolean value.

Applies To

The CBool function can be used in the following versions of Microsoft Access:

  • Access 2019, Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000

Example in VBA Code

The CBool function can be used in VBA code in Microsoft Access.

For example:

Dim LCompare as Boolean

LCompare = CBool(1=2)

In this example CBool(1=2) would return false. The variable LCompare would now contain the value false.