Using an Input Mask


graphics/04inf06.jpg

graphics/one_icon.jpg

After you've opened the table you want to change in Design view, click in the field to which you want to apply an input mask (in this example, the Artist Phone field).

graphics/two_icon.jpg

In the property sheet, click in the Input Mask field. A button featuring an ellipsis appears to the right of the field.

graphics/three_icon.jpg

Click the ellipsis button.

INTRODUCTION

One way to simplify data entry is to use an input mask . Input masks are similar to the display formats discussed in the preceding task, but input masks are displayed before data is entered in a field and are meant to indicate to the person entering data what an appropriate entry for the field might be. For example, you might use an input mask containing parentheses and a dash for a phone number field so that entries appear as follows : (555) 555-1212. You can also select input masks for other common fields such as ones for social-security numbers and ZIP codes.

graphics/04inf07.jpg

graphics/four_icon.jpg

Access prompts you to save the database before continuing. Click Yes .

graphics/five_icon.jpg

Access launches the Input Mask Wizard; the first screen displays a list of available input masks. Select the input mask you want to apply to this field.

TIP

Customizing Input Masks

Access includes several common input masks, but you can create your own. For instance, you may want to set up a mask for a product number. To do so, choose a similar mask from the Input Mask list found in the first screen of the Input Mask Wizard, but click Edit List rather than Next . Create the new entry, using Access's help system for specific instructions.

graphics/04inf08.jpg

graphics/six_icon.jpg

To see how the input mask looks, type a phone number in the Try It text box. If you're satisfied, click Next to continue.

graphics/seven_icon.jpg

The next screen of the wizard appears. In the Placeholder character list, click the character you want Access to display as a placeholder in the input mask.

graphics/eight_icon.jpg

Click Next .

TIP

Validating Data with Input Masks

Because input masks require that a certain number of characters be entered, they can serve an important role in data validation. If someone enters the wrong number of characters in an input-mask field by accident , Access displays an error message noting that fact.

graphics/04inf09.jpg

graphics/nine_icon.jpg

The Input Mask Wizard asks you how you want to store the data that is entered ”with or without the symbols used in the input mask. Make your selection and click Next .

graphics/ten_icon.jpg

Click Finish .

TIP

Backing Up

If necessary, you can click the Back button found in the various Input Mask Wizard screens to go back a step and modify an earlier selection.

graphics/04inf10.jpg

graphics/eleven_icon.jpg

The new input mask is added to the property sheet. Click the View toolbar button to toggle to Datasheet view.

graphics/twelve_icon.jpg

Before it changes to Datasheet view, Access prompts you to save the changes to the table; click Yes to do so.

graphics/thirteen_icon.jpg

Any blank fields for this field contain the selected input mask and placeholders. Here, you type only the digits in the phone number, not the parentheses around the area code or the dash within the number.

TIP

Placeholders

Placeholders are the characters that appear in the datasheet when you are entering data in the input mask field.



Easy Microsoft Office Access 2003
Easy Microsoft Office Access 2003
ISBN: 789729598
EAN: N/A
Year: 2003
Pages: 174

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net