Using an Input Mask to Ensure Consistent Data Entry in Access 2007

Microsoft Access, Tips & Tricks Add comments

Microsoft Access tutorial tweak The data in a particular field may be valid, but it can still be problematic if it’s not consistent For example, if your table has a field to store phone numbers, each entry might b valid in the sense that it has ten digits: a three-digit area code and a seven-digit local number However, there are many ways to enter those ten digits in the table:

(317)555-6789
(317) 555-6789
(317)5556789
317-555-6789
317555-6789
31735556789

With such inconsistencies, you are going to have all kinds of trouble trying to sort on thi field, find data within this field, define query criteria on this field, and so on. Perhaps yo might never think of performing these database tasks on a phone number field, but yo might on social security numbers, ZIP codes, dates, times, account numbers, and so on, an those items can also get entered inconsistently.

In the previous section, you saw an example where the user was shown status bar text that described exactly how to enter a date (see Figure 1 and 2):

The order date in MM/DD/YYYY format

Again, however, it’s entirely possible (perhaps even likely) that the user might miss the statu bar message and enter the data willy-nilly. As with data validation, you need to configur your field to automatically enter data using the format you prefer. You do that b applying an input mask to the field. An input mask acts like a template that lets the user se how the data should be entered. The input mask can also prevent the user from typin invalid characters (such as a letter where a number is required).

Here’s an example input mask that you might see when you enter a table’s phone number field (Access calls this a data look):

(___) ___-____

Each underscore (_) acts as a placeholder for a character, and you can specify what type o character is valid (numbers, in this case). The other characters in the input mask—th parentheses around the area code, the space that comes after the area code, and dash in th local number—display automatically as the user enters the field. When the user types digit, the insertion point automatically moves to the next placeholder, skipping over extr characters such as the parentheses, spaces, and dashes. So the user types just the ten digit of the phone number, and the result is a field that looks like this:

(317) 555-6789

You can type input masks directly, but creating them is easiest when you use the Input Mask Wizard, as shown in the following steps:

1. Open the table you want to work with in Design view (right-click the table in the Navigation pane and then click Design View) and then click the field with which you want to work.

2. Click inside the Input Mask property.

3. Click the ellipsis (…) button to start the Input Mask Wizard

4. In the Input Mask list, click the input mask with the data look you want (or one that’s close to what you want). To check out the resulting input mask, click inside the Try It box and then enter a value.

5. Click Next.

6. Use the Input Mask text box to make changes to the mask (see Tables 1 and 2 for the specifics about which symbols to use).

7. Use the Placeholder Character list to choose the character you want to display in the input mask as a placeholder. (Again, you can click inside the Try It box to give the input mask a whirl.)

Using an Input Mask to Ensure Consistent Data Entry in Access 2007
With the Input Mas Wizard, you can eithe select a predefined inpu mask or create a custo input mask.

Popularity: 2% [?]

Pages: 1 2

Related Post

  • Using a Ready-Made Mask in Access 2007
  • Input Masks in Access 2007
  • Using Dialog Box Controls to Input Data in Excel 2007
  • Allowing Only Certain Values in a Cell
  • Calculating Multiple Solutions to a Formula in Excel 2007
  • Don't Find What You're Looking For? Please Try Here...

    Google
     

    Leave a Reply

    WP Theme & Icons by N.Design Studio
    Entries RSS Comments RSS Add to Technorati Favorites Log in