Access Logical Operators

This page lists the logical (or Boolean) operators in Access VBA. The values bool1 and bool2 in the examples are variables or expressions with the value True or False. Refer to Access Help for details of their behaviour when either or both arguments are Null.

Note that these operators can also process numeric values. They do this by considering each bit in the binary number as a boolean value where 1=True and 0=False.

<bool1> And <bool2> The And operator returns True if both <bool1> and <bool2> are true.
<bool1> Eqv <bool2> The Equivalence operator returns True if <bool1> and <bool2> have the same value.
<bool1> Imp <bool2> The Implication operator returns False if <bool1> is True and <bool2> is false. Otherwise it returns True.
Not (<bool1>) The Not operator returns True if <bool1> is False. It returns False if <bool1> is True. If <bool1> is a numeric value the Not will return a number where each bit of <bool1> has been inverted.
<bool1> Or <bool2> The Or operator returns True if either one of <bool1> or <bool2> are True or if both of them are True. Do not confuse this with the Xor operator described below.
<bool1> Xor <bool2> The Exclusive Or operator returns True if either one of <bool1> or <bool2> are True but not if both of them are True or if both of them are False.

Other functions

Access Date and time functions

Access numeric functions

Access text functions