When you type data in a field for which you've defined an input mask, the data is always entered in Overtype mode. You can also set the InputMask property by using a macro or Visual Basic. For a field in a table, you can set the property in table Design view (in the Field Properties section) or in Design view of the Query window (in the Field Properties property sheet ).
You use the Password input mask to prevent displaying the typed characters on the screen.įor a control, you can set this property in the control's property sheet. Any character typed in the control is stored as the character but is displayed as an asterisk (*). Note Setting the InputMask property to the word "Password" creates a password-entry control. \ Causes the character that follows to be displayed as the literal character (for example, \A is displayed as just A). You can include the exclamation point anywhere in the input mask. Characters typed into the mask always fill it from left to right. ! Causes the input mask to display from right to left, rather than from left to right. Causes all characters to be converted to uppercase.
(The actual character used depends on the settings in the Regional Settings Properties dialog box in Windows Control Panel). , : - / Decimal placeholder and thousand, date, and time separators. & Any character or a space (entry required).Ĭ Any character or a space (entry optional).
# Digit or space (entry not required spaces are displayed as blanks while in Edit mode, but blanks are removed when data is saved plus and minus signs allowed). You can define an input mask by using the following characters.Ġ Digit (0 to 9, entry required, plus and minus signs not allowed).ĩ Digit or space (entry not required, plus and minus signs not allowed). These characters specify the type of data, such as a number or character, that you must enter for each character in the input mask.
When you create an input mask, you can use special characters to require that certain data be entered (for example, the area code for a phone number) and that other data be optional (such as a telephone extension). For example, the following specifies an input mask for a text box control used for entering a phone number:įorms!Customers!Telephone.InputMask = "(#) #-#" In Visual Basic you use a string expression to set this property. For this section, you can use any character to display an empty string, use a space enclosed in quotation marks (" "). Third Specifies the character that Microsoft Access displays for the space where you should type a character in the input mask. If you use 0 for this section, all literal display characters (for example, the parentheses in a phone number input mask) are stored with the value if you enter 1 or leave this section blank, only characters typed into the control are stored.
Second Specifies whether Microsoft Access stores the literal display characters in the table when you enter data. For a list of characters you can use to define the input mask, see the following table. The InputMask property can contain up to three sections separated by semicolons ( ).įirst Specifies the input mask itself for example, !(999) 999-9999.
It is often easier to use the Input Mask Wizard to set the property for you.
Input masks are helpful for data-entry operations such as an input mask for a Phone Number field that shows you exactly how to enter a new number: (_) _-_. An expression that returns one of the objects in the Applies To list. See AlsoApplies ToExampleSpecificsYou can use the InputMask property to make data entry easier and to control the values users can enter in a text box control. If you handle this though, you should be able to make it nice and operator-proof. It's an area that few people are familiar with, but quite powerful nevertheless.Ĭareful with how the field is entered though, there are situations where users get confused as they go to the field and find themselves at the RIGHT hand end rather than at the left.
This covers all the topics you've asked about, but if you still have problems please come back for more. There is quite a bit of helpful explanation of the Input Mask property in the help file so I'll quote it here for you.