You can use the Input Mask property (for text or date/time data types only) to ensure that data gets entered in the correct format. For instance, you might want the phone number field to be in the format: (000) 000-0000. Using an input mask will not only ensure that the data is in a particular format, but it also saves you the trouble of typing certain characters, like parenthesis or hyphens. In the telephone number example, Access would not let you enter a number without an area code or would not let you save a record that did not contain the required number of characters.
For common types of entries such as phone numbers, social security numbers, dates, or zip codes, use the Input Mask Wizard by clicking on the Build button in the Input Mask property box and then choose one of the available pre-defined Input Masks.
For entries not supported by the Input Mask Wizard, you can create your own Input Mask manually. The Table below lists the characters available to create a manual Input Mask. The Input Mask contains 3 sections, each separate by a semicolon:
- The mask characters listed in the table below.
- Enter 1 if you want all literal placeholders to be saved with the data. Enter 0 (or leave blank) to save only the characters in the field.
- Optional: Enter the placeholder that you want to appear on-screen as the user enters data.
For example, let’s say we had an employee number in the following format: ######-##. The first 6 characters are required and must be numbers, and the two characters after the dash can be letters or numbers and are optional. We also want an underscore (_) as a placeholder. Thus, our manual Input Mask would be entered as 000000-aa;1;_. See the breakdown below.
Input Mask Characters
Character Description
0 Number (0 through 9, entry required; plus and minus signs are not allowed).
9 Number or space (entry optional; plus and minus signs not allowed).
# Number or space (entry optional; plus and minus signs allowed).
L Letter (A through Z, entry required).
? Letter (A through Z, entry optional).
A Letter or number (entry required).
a Letter or number (entry optional).
& Any character or a space (entry required).
C Any character or a space (entry optional).
. , : ; – / Decimal placeholder and thousands, date, and time separators.
< Converts all characters that follow to lowercase.
> Converts all characters that follow to uppercase.
! Characters are displayed from right to left, rather than from left to right.
\ Causes the character that follows to be displayed as a literal character (for example, \A is displayed as just A).
Password Creates a password entry text box. Any character typed in the text box is stored as the characters but is
displayed as an asterisk (*).
To Create an Input Mask
1. Select the table that contains the field for which you want to create an Input Mask.
2. Switch to Design View.
3. Click anywhere in the row of the field to receive the Input Mask.
4. To enter an Input Mask manually, type the desired characters in the Input Mask box in the Field Properties area.
5. To enter an Input Mask using the wizard:
a. Click in the Input Mask box in the Field Properties area.
b. Click the Build button.
c. Chose the desired Input Mask from the list box.
d. Click Next.
e. Make any desired changes to the Input Mask characters or to the placeholder.
f. Click Next.
g. Select whether to store data with the literals or without the literals.
h. Click Finish.
Similar Posts:
- None Found




Comments on this entry are closed.