The three parts of an input mask
Input masks are made up one mandatory part and two optional parts, and each part is separated by a semicolon. The purpose of each part is as follows:
- The first part is mandatory. It includes the mask characters or string (series of characters) along with placeholders and literal data such as, parentheses, periods, and hypens.
- The second part is optional and refers to the embedded mask characters and how they are stored within the field. If the second part is set to 0, the characters are stored with the data, and if it is set to 1, the characters are only displayed and not stored. Setting the second part to 1 can save database storage space.
- The third part of the input mask is also optional and indicates a single character or space that is used as a placeholder. By default, Access uses the underscore (_). If you want to use another character, enter it in the third part of your mask.
For example, this is an input mask for a telephone numbers in the U.S. format:
(999) 000-000;0;-:
- The mask uses two placeholder characters, 9 and 0. The 9 indicates an optional digit (which makes it optional to enter an area code), and each 0 indicates a mandatory digit.
- The 0 in the second part of the input mask indicates that the mask characters will be stored along with the data.
- The third part of the input mask specifies that a hyphen (-) instead of the underscore (_) is to be used as the placeholder character.