Part I: Access Building Blocks
52
Memo data type
The Memo data type holds a variable amount of data from 0 to 65,536 characters for each record.
So, if one record uses 100 characters, another requires only 10, and yet another needs 3,000, you
use only as much space as each record requires.
You don’t specify a field size for the Memo data type. Access allocates as much space as necessary
for the memo data.
Number data type
The Number data type enables you to enter numeric data — that is, numbers that will be used in
mathematical calculations or represent scalar quantities such as inventory counts. (If you have data
that will be used in monetary calculations, you should use the Currency data type, which performs
calculations without rounding errors.)
The exact type of numeric data stored in a number field is determined by the Field Size prop-
erty. Table 2.3 lists the various numeric data types, their maximum and minimum ranges, the deci-
mal points supported by each numeric data type, and the storage (bytes) required by each numeric
data type.
TABLE 2.3
Numeric Field Settings
Field Size Setting Range Decimal Places Storage Size
Byte 0 to 255 None 1 byte
Integer –32,768 to 32,767 None 2 bytes
Long Integer –2,147,483,648 to 2,147,483,647 None 4 bytes
Double –1.797 × 10308 to 1.797 × 10308 15 8 bytes
Single –3.4 × 1038 to 3.4 × 1038 7 4 bytes
Replication ID N/A N/A 16 bytes
Decimal 1–28 precision 15 8 bytes
Caution
Many errors are caused by choosing the wrong numeric type for number fields. For example, notice that the
maximum value for the Integer data type is 32,767. I once saw a database that ran perfectly for several
years and then started crashing with overflow errors. It turned out that the overflow was caused by a particular
field being set to the Integer data type, and when the company occasionally processed very large orders, the
32,767 maximum was exceeded.
Be aware that overflow may occur simply by adding two numbers together, or performing any mathematical
operation that results in a value too large to be stored in a field. Some of the most difficult bugs occur only
when circumstances (such as adding or multiplying two numbers) cause an overflow condition at runtime.