Table Design   «Prev  Next»
Lesson 6 Taking Advantage of Data Types
Objective Learn to use the correct data type and field properties for optimal performance in Microsoft Access.

Use Correct Access Data Type for Optimal Performance

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.

Why correct data type matters

  • Integrity: A Date/Time field rejects invalid dates automatically; a Short Text field cannot.
  • Query correctness: Text sorting is alphabetical; numeric sorting is numeric. Mixing them causes subtle bugs (for example, "100" sorting before "20").
  • Indexing and joins: Correct numeric key types and indexed foreign keys improve join performance and filtering.
  • Storage efficiency: Storing “small numbers” as Double wastes space; storing codes as numeric can destroy leading zeros.

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.

Common data types in Access 365

Access includes several data types; these are the ones you’ll use most often:

  • Short Text (formerly “Text”): Up to 255 characters. Names, codes, IDs like SSN, phone, ZIP.
  • Long Text (formerly “Memo”): Long notes. Not ideal for searching/sorting; indexing is limited.
  • Number: Numeric values with a Field Size subtype (Byte/Integer/Long Integer/Single/Double).
  • Large Number: For 64-bit integers (when you truly need values beyond Long Integer range).
  • Date/Time: Dates and times for calculations, filtering, and validation.
  • Currency: Fixed-point money values (avoids floating-point rounding errors).
  • AutoNumber: System-generated unique values (commonly used as a surrogate primary key).
  • Yes/No: Boolean values.
  • Attachment: Stores files in the database (use thoughtfully; it can inflate database size).
  • Hyperlink: URL/email links (useful for UI; not a substitute for normalized relationships).

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.

Practical example: Consultants table design

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.

Access Data Types
The image shows the design view of a Microsoft Access table named Consultants. Below is a transcription summary of the fields and the SSN field properties shown in the design pane.

Table Name: Consultants

Field Definitions
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.

Field Properties (SSN field selected)
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.

Observations
  • 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.

Refining data types with field properties

After you choose a data type, the Field Properties pane in Design View lets you tune behavior. For performance, these properties matter most:

  • Field Size: controls storage allocation and allowable values (critical for Short Text and Number).
  • Indexed / Unique: speeds filtering and joins, and can enforce uniqueness when appropriate.
  • Required / Allow Zero Length: controls Nullability and prevents “blank-but-not-null” data quality issues.
  • Input Mask: improves entry consistency for formatted identifiers (SSN, phone, postal codes).
  • Validation Rule + Validation Text: enforces business rules with clear user feedback.
  • Default Value: reduces repetitive data entry and supports consistent records.

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.

Specifying Field Size in Access

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.

Field Size for Short Text

  • Choose a maximum length that reflects reality. For example, if you only store two-letter state codes, set Field Size to 2.
  • For formatted identifiers, size the field to match what you store. If you store SSNs with dashes, allow enough characters for the literals.

Field Size for Number

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 Options for Number Data Type
The Field Size property for a Number field determines value range and storage size.
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.

Design guidance that improves performance

  • Keys: Use AutoNumber (Long Integer) for primary keys and match foreign keys to the same numeric type.
  • Index deliberately: Index join columns and frequently filtered fields. Avoid indexing fields that are rarely searched.
  • Avoid “everything as text”: It forces conversions in queries and undermines sorting, filtering, and validation.
  • Prefer normalized lookup tables: Store a foreign key value (Number) and display a friendly label in forms. This scales better than stuffing repeated text values into every record.
  • Be careful with Attachment: It’s convenient, but it can bloat file size and complicate backups. Often, storing a file path (Short Text) plus a controlled storage location is a better fit.

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.

Key takeaways

  • Choose native types so Access can validate, sort, and optimize queries correctly.
  • Use Field Size intentionally to reduce storage and prevent invalid ranges.
  • Use field properties (Input Mask, Required, indexing, validation) to reinforce integrity and usability.
  • Model identifiers correctly (SSN as Short Text) and model quantities correctly (Number/Currency/Date-Time).

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.

SEMrush Software 6 SEMrush Banner 6