Part I: Access Building Blocks
172
Note
You’ll see the term evaluate a lot in this chapter. When you present Access with a field, expression, variable,
and so on, Access evaluates the item and (internally) represents the item as a value. It’s very important to com-
pose expressions in such a way that Access evaluates them as we expect. If Access incorrectly evaluates an
expression, the application will not perform as expected. Understanding how Access evaluates a query’s crite-
ria or an expression used in VBA code is critically important to success as an Access developer.
You’ll use operators every time you create an equation in Access. For example, operators specify
data validation rules in table properties, create calculated fields in forms and reports, and specify
criteria in queries.
Operators indicate that an operation needs to be performed on one or more items. Here are some
common examples of operators:
= & And Like +
Looking at the types of operators
Operators can be grouped into the following types:
l Mathematical operators
l (^) Comparison operators
l String operators
l (^) Boolean (logical) operators
l Miscellaneous operators
Mathematical operators
Mathematical operators are also known as arithmetic operators, because they’re used for perform-
ing numeric calculations. By definition, you use mathematical operators to work with numbers as
operands. When you work with mathematical operators, numbers can be any numeric data type.
The number can be a constant value, the value of a variable, or a field’s contents. You use these
numbers individually or combine them to create complex expressions.
Note
Some of the examples in this section may seem complex, but trust me: You don’t need a graduate degree in
mathematics to work through them.