| Lesson 6 | Taking Advantage of Data Types |
| Objective | Learn to use the correct data type and field properties for optimal performance in Microsoft Access. |
In Microsoft Access, data types are not cosmetic. The data type you pick determines how values are stored on disk, which operators and functions work correctly in queries, what validations Access can apply automatically, and how well your tables can be indexed and joined. A “works for now” design decision—like storing dates in a Short Text field—often becomes a performance and maintenance problem later.
In this lesson you’ll review common Access data types, see how data types and field properties work together in a real table, and learn how to refine a design using Field Size, Input Mask, Required, and indexing choices. The goal is simple: choose types and properties that preserve data integrity and keep queries fast.
As a rule: store data in its native type (dates as dates, quantities as numbers, currency as Currency, true/false as Yes/No), and store “formatted identifiers” (SSN, postal codes, product codes) as Short Text so you do not lose leading zeros or formatting.
Access includes several data types; these are the ones you’ll use most often:
A quick performance guideline: keep keys and join columns simple and stable (AutoNumber / Long Integer, or other compact numeric types), and avoid using Long Text or Attachment fields as join/search workhorses.
The figure below shows a table named Consultants in Design View. The key point is how the chosen data types and
field properties reinforce integrity and usability—especially on fields that users type frequently.
Consultants.
Below is a transcription summary of the fields and the SSN field properties shown in the design pane.
Consultants
| Field Name | Data Type | Description |
|---|---|---|
ConsultantID |
AutoNumber | Primary key (indicated by key icon). Uniquely identifies each consultant. |
LastName |
Short Text | Consultant last name. |
FirstName |
Short Text | Consultant first name. |
SSN |
Short Text | Social Security Number stored as text to preserve formatting and leading zeros. |
ConsultingTypeID |
[Not yet defined] | Field name created, but a data type has not been selected yet. |
| Property | Value | Notes |
|---|---|---|
| Field Size | 13 | Maximum number of characters allowed for this Short Text field. SSNs typed with dashes require more than 9 characters. Set this to match the format you store. |
| Format | (Blank) | No display formatting applied. |
| Input Mask | 000-00-0000 |
Guides entry so users type an SSN in the expected shape. |
| Caption | (Blank) | No alternate label defined for UI display. |
| Default Value | (Blank) | No default value. |
| Validation Rule | (Blank) | No expression-based rule applied. |
| Validation Text | (Blank) | No custom message configured. |
| Required | No | Field is optional (allows Null unless a form enforces otherwise). |
| Allow Zero Length | No | Prevents empty string values (""). Note: this is different from Null. |
| Indexed | No | Not indexed. Add an index only if you frequently search or enforce uniqueness on SSN. |
| Unicode Compression | Yes | Saves space for text when possible. |
ConsultantID as AutoNumber is a common, efficient primary key strategy for Access tables.
SSN is correctly modeled as Short Text because it is an identifier, not a quantity you calculate.
This also preserves leading zeros.
ConsultingTypeID is likely a foreign key. In Access, you typically store the numeric key value and use a
combo box (or a lookup table) to display a friendly label.
This example highlights a design pattern you should reuse: choose the correct data type first, then set field properties to control entry and storage. That combination is where Access gives you both data integrity and good performance.
After you choose a data type, the Field Properties pane in Design View lets you tune behavior. For performance, these properties matter most:
Neighboring topic to keep in mind: many “validation problems” are actually “data type problems.” If a field is typed as Short Text, you will eventually write query expressions that cast or convert values, which slows queries and increases the chance of edge-case failures. Use native types so Access can optimize operations without conversions.
Field Size controls how much data a field can store. When you size fields correctly, you reduce storage, improve index efficiency, and prevent invalid values from being stored.
2.
For the Number data type, Field Size selects the numeric subtype. Smaller subtypes store fewer bytes and can be faster to index. Use the smallest subtype that safely supports your range of values.
| Field Size | Stores | Storage Size |
|---|---|---|
| Byte | Whole numbers from 0 to 255 | 1 byte |
| Integer | Whole numbers from -32,768 to 32,767 | 2 bytes |
| Long Integer | Whole numbers from -2,147,483,648 to 2,147,483,647 | 4 bytes |
| Single | Floating-point numbers with about 7 digits of precision | 4 bytes |
| Double | Floating-point numbers with about 15 digits of precision | 8 bytes |
Use Integer/Long Integer for counts and keys. Use Currency for money. Use floating-point types only when you truly need fractional values.
Neighboring topic: input masks and validation text improve data entry, but they do not replace proper data types and relationships. Use data types for storage integrity, relationships for referential integrity, and forms for user-friendly entry.
Next, you’ll build on these design choices by using lookup strategies and other table design enhancements that keep data consistent while improving the user experience.