Data Manipulation  «Prev  Next»

Lesson 4 Changing the data type
Objective Edit the data type for a field in MS Access

Change a Field Data Type in Microsoft Access

In Microsoft Access, the data type you choose for a field controls how the data is stored, validated, sorted, and indexed. In most cases the choice is obvious—names are text, dates are date/time, and quantities are numbers. The problems start when a value looks numeric but should be stored as text.

Common “looks like a number, but isn’t” fields:
  • ZIP/postal codes (leading zeros matter; some countries include letters)
  • Phone numbers (parentheses, spaces, hyphens, extensions)
  • Government IDs such as SSNs (formatting characters; leading zeros)
  • Part numbers / SKUs (often include letters and padding)
In this lesson you will practice changing a field’s data type in Table Design View, using ZIP codes as the classic example. The goal is to prevent Access from stripping leading zeros and to make future data entry consistent.

The Design View Workflow

  1. Understand the issue: This table contains client names and addresses. The last field stores ZIP codes. If Access originally detected the ZIP field as a Number, any leading zeros were lost (for example, 01234 becomes 1234). To preserve formatting, ZIP codes should typically be stored as Short Text.
  2. Open the table in Design View: In the Navigation Pane, right-click the table and select Design View. If you are already viewing the table in Datasheet View, you can switch by selecting the View dropdown on the ribbon and choosing Design View.
  3. Change the field’s data type: In the top grid, locate the Zip field (or your ZIP field name). Click the Data Type cell and select Short Text from the dropdown.

    Recommended settings for ZIP codes:
    • Data Type: Short Text
    • Field Size: 10 (US ZIP+4 is 10 including the hyphen, e.g., 12345-6789)
    • Optional: Input Mask to guide entry (covered later in this course)
  4. Save the table design: When you switch back to Datasheet View, Access will prompt you to save the table. Click Yes. This commits the schema change.
  5. Validate the outcome: The table may not look different immediately, but from this point forward, Access will preserve leading zeros in the ZIP field.

    Important: values that were already stored incorrectly (for example 1234 instead of 01234) typically need to be corrected manually or via an update query—because Access cannot infer which leading zeros were originally intended.

What to Watch for When Changing a Data Type

Changing a field’s data type is a schema change. In modern Access (Microsoft 365 / Access 2021/2024), the UI makes the change easy, but you still need to think about downstream impact:
  • Data conversion risk: some values may not convert cleanly (for example, text like 12A cannot convert to Number).
  • Queries and forms/reports: expressions, joins, and criteria may behave differently after a type change.
  • Indexes and sorting: numbers sort numerically, text sorts lexicographically. A ZIP stored as text sorts correctly for ZIP semantics.
  • Linked tables: if the table is linked to another source (SQL Server, SharePoint, etc.), the data type may need to be changed at the source.
  • Validation rules / masks: review Field Properties so users enter the data consistently after the change.
A practical rule: if you will ever format the value with non-numeric characters, or the value is an identifier rather than a quantity, store it as text.

Controlling Data Entry

One benefit of picking the correct data type is that it prevents obvious errors. For example, if a field is defined as Number, Access will reject alphabetic characters.

However, a correct data type alone does not guarantee clean data. Modern Access design typically uses several layers of protection:
  • Input masks to guide entry format (useful for phone numbers, ZIP codes, IDs)
  • Validation rules to enforce business rules (for example, quantities must be > 0, dates must be >= today)
  • Lookup lists / combos to reduce free-form typing and standardize values
  • Forms as the primary data entry surface (instead of direct table editing), because forms can enforce workflow and validation
In Access, you configure many of these controls in the Field Properties pane (bottom pane) of Table Design View. Validation rules are often paired with Validation Text so the user sees a clear message when an entry is rejected.

Data Type Usage - Exercise

The following exercise tests your understanding of choosing and changing data types.
Data Type Usage - Exercise

SEMrush Software 4 SEMrush Banner 4