📝

Input Masks in Access

Sep 10, 2025

Overview

This lecture explains input masks in Microsoft Access, detailing the codes used to enforce specific data entry formats in table fields.

What Are Input Masks?

  • Input masks are codes that define the required format for data entered in a field.
  • They ensure users enter data in the desired structure, preventing invalid entries.

Input Mask Codes

  • Digits: 0 for compulsory digit (0-9), 9 for optional digit.
  • Letters: L for compulsory letter, ? for optional letter.
  • Letter or Digit: A for compulsory letter/digit, a for optional letter/digit.
  • Any Character or Space: & for compulsory, C for optional.
  • Additional codes exist, but these are the main ones for beginners.

Input Mask Examples

  • South African license plate: three letters, three digits, two letters = LLL000LL.
  • Use > before letters to force uppercase (e.g., >LLL000LL).
  • Use < to force lowercase letters.
  • Use " around literal text or / before a character to display it literally.

Applying and Using Input Masks

  • Access includes an Input Mask Wizard to help set up masks.
  • When an input mask is set, only entries matching the format are accepted.
  • Example: entering a license plate with an input mask only allows valid letters/numbers in designated positions.

Optional and Compulsory Entries

  • Optional code (like 9 or a) allows a field to be left blank at that position.
  • Example: phone number with an optional last digit: 000 000 0000;0;_ (last digit is optional).

Format Property vs Input Mask

  • > (uppercase) and < (lowercase) can also be used in the Format property to change case of entered text automatically.

Key Terms & Definitions

  • Input Mask — A code pattern that specifies required data format for a field.
  • Compulsory — Required value at a specific position (e.g., 0, L, A, &).
  • Optional — Value can be present or blank (e.g., 9, ?, a, C).
  • Wizard — Built-in helper for creating input masks in MS Access.

Action Items / Next Steps

  • Practice creating and applying input masks to different fields in Access.
  • Experiment with input masks for various data types (e.g., license plates, phone numbers).
  • Explore use of Format property for auto-capitalization or lowercasing.