• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Working with Forms > Using Input Masks

Using Input Masks

Wouldn't it be nice if you could make entering data easy? If say, you could set up your telephone number field so that it prompted the user to enter a three-digit area code, a three-digit exchange, and a four-digit identifier? Well you can, and it's not very difficult to do.

An input mask is a tool that specifies the format of data entered into a field. To ensure phone numbers are entered in the proper format, for instance, you can create an input mask like (###) ###-####, where each # is a space for a number from 0–9 to be entered.

To use an input mask:

1.
Open your form in Design view, click the control corresponding to the field you want to set the input mask for, and click the Properties toolbar button ( Figure 4.32 ).

Figure 4.32. Clicking the Properties button gets you to the heart of your control.


2.
In the Properties dialog box, click the Data tab and click Input Mask.

A Build button will appear to the right of the property ( Figure 4.33 ).

Figure 4.33. The Build button next to the Input Mask property launches a wizard that you can use to define your mask.


3.
Click the Build button to launch the Input Mask Wizard.

4.
Click the Input Mask you want from the list and click Next ( Figure 4.34 ).

Figure 4.34. Select a mask from the list.


You can modify your input mask here as well as change the placeholder character. Click Next when the mask looks the way you want it to ( Figure 4.35 ).

Figure 4.35. Customize the appearance of your input mask by choosing a placeholder character.


5.
Determine how you want to store the field's data and click the appropriate option button. Click the "With the symbols in the mask" option button to store the symbols with the data.

or

Click the "Without the symbols in the mask" option button to store the data on its own. Click Next to continue.

Unless you're short on space, you should probably store the data with the mask characters.

6.
You're done! Click Finish to set your field's input mask.

Tip

If none of the pre-fab masks are exactly what you want, create your own by clicking the Edit List button to display the Customize Input Mask Wizard.


Tip

To test drive your input mask before finishing up the wizard, click in the Try It text box, which is available at the bottom of most of the wizard pages.


Tip

To use the Access Help files to create input masks, ask the Office Assistant about the "InputMask Property."


  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint