Database Reference
In-Depth Information
0 tells Access to store both the characters entered and the literal characters. Entering a
character in the third section causes Access to display that character as the placeholder for
each of the characters to be entered; leaving it blank causes Access to display an under-
score as the placeholder.
The input mask !\(000”) “000\-0000;1;# creates this display in a field in either a table or a
form:
(###) ###-####
In this example, the 0s in the first part of the mask restrict the entry to 10 digits—no more
and no less. The database user does not enter the literal characters—the parentheses,
space, and hyphen. The 1 in the second part tells Access to store only the 10 digits, not the
literal characters. The # sign in the third part tells Access to use that character as the place-
holder for the required 10 digits.
TIP An input mask can contain text in addition to placeholders for the data to be entered.
For example, if you enter The number is in front of the phone number input mask, the
default entry for the field is The number is (###) ###-#### . The numbers you enter replace
the # placeholders, not the text. The Field Size property does not apply to the literal char-
acters in the mask, so if this property is set to 15, the entry will not be truncated even
though the number of displayed characters (including spaces) is 28.
6
In this exercise, you'll use the Input Mask wizard to apply a predefined input mask for a
phone number to a Short Text field. Then you'll modify the input mask to display the phone
number in a slightly different way. Finally, in another field you'll create a custom mask that
displays a text entry with an initial capital letter, no matter how it is actually entered.
SET UP You need the GardenCompany06 database you worked with in the preced-
ing exercise to complete this exercise. If necessary, open the database. Then display the
FieldTest table in Design view, and follow the steps.
1 Click the row selector for the fShortText field, and on the Design tool tab, in the
Tools group, click the Insert Rows button.
2 Add a new field named fPhone that is assigned the Short Text data type. Then save
the table.
Now let's use the Input Mask wizard to create an input mask that shows the format
expected for a phone number.
3
With the fPhone field still selected, in the Field Properties area, click anywhere in the
Input Mask property.
Search WWH ::




Custom Search