Have you ever heard about the Access Database Input Mask feature? If your answer is No…. then let’s start knowing about this awesome feature and explore something new. But if you already know about this MS Access input masks then grab more knowledge from this blog. I am quiet much sure that you will find more than what you know.
So, let’s get started….!
What Is An Input Mask In A Database?
Microsoft Access Input mask is for reducing inconsistency in datasets by defining specific character templates for fields that checks the information which users enters during the data entry. If the mask template won’t match the database will throw warning message and won’t place the record to the table until the format mismatch is get resolved.
You can say, an Access input mask is a user generated set of rules. As, you can help users to enter data correctly into your database by assigning input masks for the field which contain data that is always formatted in certain ways.
Input Mask Access examples
For example: you can use an input mask to make sure that people will enter correct format phone number into a phone number field.
Access Database input masks only affects whether Access accepts the data; it doesn’t change how the data is stored. As, this task is controlled by the field’s data type and other properties.
What Is The Purpose Of An Input Mask?
Input mask is a string of characters which indicates the format of valid input values. You can make use of this input mask when it’s compulsory that the format of the input values is consistent.
Basically you can use it in table fields, query field and controls on form or reports. Input mask is stored as an object property.
These Access Masks consist of one mandatory part and two optional parts and each part is separated with a semicolon. Purpose of each part is:
- Mandatory part:
This includes the mask character or string along with placeholders and literals data such as periods, parentheses, and hyphens.
- Optional Part 1:
This refers to the embedded mask characters and how they are stored within the field. If this part is set to 0 then the characters are stored with the data and if it is set to 1, then the characters are only displayed and don’t get stored anywhere. So setting this part to 1 can save database storage space.
- Optional Part 2:
This one is the third part and is also optional and it indicates a single character or space used as a placeholder. If you want to use any character then enter it in this third section of your mask otherwise by default Access will use the underscore (_).
What Are The Limitation To Use Access Input Masks?
MS Access input masks are not appropriate for every situation. No need to use this input mask if following circumstances apply to:
- People occasionally need to enter data that doesn’t match the mask. An input mask doesn’t throw any exception. So, in that case you need not to use it.
- While you are using a Date Picker Control with a Date/Time field. Input masks are not compatible with the date picker control.
How To Create An INPUT MASK In Access 2016/2013?
In this section i am going to share some easy tricks on how to create an input mask in Access 2016. So, that you can easily create input mask for different Access database objects like, table, form, report or query etc.
Trick 1# Adding An Input Mask To The Table:
To build an input mask for a field in an Access 2013 table by using the Microsoft Access Input Mask Wizard: You can use input mask with fields set to the text, number, currency and date/time data type.
- Go to the Navigation Pane, right click the Table and tap to the Design View on the shortcut menu.
- Tap to the field where you need to add the input mask.
- On the General tab, go to the Field Properties; hit the Input Mask property box.
- To start with input mask wizard click the Build button .
- In the Input Mask List, select the Type Of Mask that you want to add.
6.Tap to the Try It option and enter some data to test how the mask will work.
7.If you don’t want to do any changes to Input Mask then tap to the Next
8.Select the option for how you want the data to get stored
9.Hit the Finish option and save all your changes.
Trick 2# Adding Input Mask To A Form Or Report Control
- In the Navigation Pane, make a right click to the form or report you wants to change and click design view on the shortcut menu.
- Make a right click to the Control that you want to change. After then click to the Properties option on the shortcut menu.
- On the All tab, tap to the Input Mask property box.
- To start the input mask wizard hit the Build button, and then carefully follow the instruction in the wizard.
Trick 3# Adding Input Mask To A Query
- From the navigation pane, make a right click to the query that you want to change and click to the Design View on the shortcut menu.
- In the query design grid, keep the pointer in the column for the field you wants to change. You can keep the cursor to any row of that field too.
- To open the property sheet for the field, Press F4.
- Within the Field Properties, on the General tab, tap to the Input Mask property box.
- Now hit to the Build button to open the Input Mask Wizard. After then follow the instructions carefully in the wizard.
How To Create Custom Input Masks?
Input masks wizard provides input masks for the common formatting needs. But do you know you can create your own custom input mask as per your requirement. Access database input masks can be customized in two way:
Either by changing the predefined masks from the input mask wizard
By manually changing the input masks property for a field where you want the mask to be applied.
Customize Input Masks From The Input Mask Wizard
- Open object in Design View and tap to the field where you wants to apply the Custom Input Mask.
- To start the Input Mask Wizard tap to the Build.
- Now hit the Edit List option.
This will open the Customize Input Mask Wizard dialog box.
- Now move to the new record in the dialog and enter New Description in the Description text box.
- In the input mask text box, enter the placeholders and characters using the allowed characters from the table
- Now hit the Mask Type down arrow to make selection for the appropriate mask type.
- Tap to the Close option. Now the new input mask will displays in the list.
After knowing this very helpful Access Input Masks feature complete details. Now you can use this in your Access Database Table, Query, Form Or Report Control or simply customize your own input masks on your own.
To learn MORE features of Access database visit this link: http://shrsl.com/mts7