contents.gifindex.gifprev1.gifnext1.gif

Eqv Operator

Purpose

Used to perform a logical equivalence on two expressions.

Syntax

result = expr1 Eqv expr2

Notes

If either expression is a Null, result is also a Null. When neither expression is a Null, result is determined according to the following table.

If expr1 is
And expr2 is
result is


true (nonzero)
true
True (-1)
true
false (0)
False (0)
false
true
False
false
false
True


The Eqv operator performs a bit-wise comparison of identically positioned bits in two numeric expressions and sets the corresponding bit in result according to the following truth table.

If bit in expr1 is
And bit in expr2 is
result is


0
0
1
0
1
0
1
0
0
1
1
1
Bit-wise comparisons can be performed only in Access Basic.

Example

This example prints a message that depends on the value of variables A, B, and C, assuming that no variable is a Null. If A = 10, B = 8, and C = 6, both expressions evaluate True. As a result, the Eqv expression also evaluates True.

If A > B Eqv B > C Then

Debug.Print "Both expressions are True or both are False."

Else

Debug.Print "One expression is True and one is False."

End If