ACC: Input Mask Character (!) Does Not Work as Expected

Last reviewed: May 28, 1997
Article ID: Q114880
The information in this article applies to:
  • Microsoft Access 2.0, 7.0, 97

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

When you use the exclamation point character (!) in an input mask, the characters do not fill from right to left as you type them. Instead, the characters fill from left to right.

For example, when you type numbers into the following phone number input mask created by the Input Mask Wizard

   !\(999") "000\-0000;;_

characters fill from left to right as you type them.

CAUSE

The exclamation point character does not affect how characters fill into the input mask when you type them. Characters typed into the input mask always fill from left to right. The exclamation point character determines how committed (or existing data) is displayed in the input mask.

For example, if you type the number 5550248 into the following input mask examples, the characters fill from left to right as you type them. However, when you press ENTER to accept the data, the results are displayed as follows:

   Input Mask                     Result
   -------------------------------------------
   !\(999") "999\-9999;;_         ( ) 555-0248
   \(999") "999\-9999;;_          (555) 024-8

NOTE: This example differs from the input mask created by the Input Mask Wizard because not all the characters in the input mask are required.

STATUS

This behavior is by design.

MORE INFORMATION

If you type the number 5550248 into the following input mask created by the Input Mask Wizard

   !\(999") "000\-0000;;_

you receive the following error message:

   In Microsoft Access 7.0 and 97:

      The value you entered isn't appropriate for the input mask '!\(999")
      "000\-0000;;_' specified for this field.

   In Microsoft Access 2.0:

      The value you entered isn't appropriate for the input mask '!\(999")
      "000\-0000;;_' specified for this field. Press Esc to cancel your
      changes.

You receive the error message because the first three digits of the number above are entered and validated into the area code part (999") of the input mask; then, when you type the rest of the digits and attempt to commit the data, the last 3 required digits of the phone number input mask are blank.

You can work around this behavior by using a more generic input mask, together with a validation rule. If you use the following example input mask and validation rule, you can type digits anywhere in the input mask even though the digits still fill from left to right when you type them:

   Input Mask: !\(999") "999\-9999;;_
   Validation Rule: Like "#######" Or Like "##########"
   Validation Text: You must enter a 7- or 10-digit phone number

NOTE: The input mask does not contain any required digits; the required digits are handled by the validation rule.

REFERENCES

For more information about Input Masks, type "input masks" in the Office Assistant, click Search, and then click to view "Examples of input masks."


Keywords : GnlInpt kbusage
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.