[ Team LiB ] Previous Section Next Section

Creating Input Masks

graphics/microsoft94_1.gif

An input mask allows you to control what values a database user can enter into a field. Input masks consist of literal characters, such as spaces, dots, parentheses, and placeholders. A placeholder is a text character, such as the underline symbol (_), that indicates where the user should insert values. An input mask for a phone number field might appear as follows: (_ _ _) _ _ _ - _ _ _ _ . The parenthesis and dash characters act as literal characters, and the underscore character acts as a placeholder for the phone number values. Access provides several predefined input masks, which cover most situations, but you can create your own customized masks, if necessary. The Input Mask Wizard is available only for text and date fields. If you want to create an input mask for numeric fields, you must enter the formatting symbols yourself.

Specify an Input Mask

graphics/1_icon.jpg

Display the table in Design view, and then click a field for which you want to specify an input mask.

graphics/2_icon.jpg

Click the Input Mask box.

graphics/3_icon.jpg

Click the Build button to start the Input Mask Wizard.

graphics/4_icon.jpg

Scroll thru the predefined list to find an input mask form.

graphics/5_icon.jpg

Type some sample values to see how the input mask affects your sample values, and then click Next.

graphics/04inf12.jpg

graphics/6_icon.jpg

If you change the input mask, type new formatting codes.

graphics/7_icon.jpg

If you want to display a different placeholder, click the Placeholder list arrow, and select the placeholder you want to use.

graphics/8_icon.jpg

Enter values to test the final version of your input mask, and then click Next.

graphics/9_icon.jpg

Indicate whether you want to store the input mask symbols along with the data values.

graphics/10_icon.jpg

Click Next, and then click Finish.

graphics/04inf13.jpg

Did You Know?

You can use the Input Mask Wizard. The Input Mask Wizard is available only for text and date fields. If you want to create an input mask for numeric fields, you must enter the formatting symbols yourself.

You can create a password mask. For sensitive data, choose the password input mask from the Input Mask Wizard. Any text the user types will be saved as the text, but displayed as an asterisk (*).


Input Mask Symbols

Symbol

Description

0

Digit 0 to 9 (required)

9

Digit 0 to 9 (optional)

A

Letter or digit (required)

a

Letter or digit (optional)

#

Digit or space

&

Any character or space (required)

C

Any character or space (optional)

L

Letter A-Z (required)

?

Letter A-Z (optional)

>

Make following characters uppercase

<

Make following characters lowercase


    [ Team LiB ] Previous Section Next Section