How to Set an Input Mask for Email in Microsoft Access

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.
Validation rules are helpful for email data entry.
Image Credit: zorabcde/iStock/Getty Images

Microsoft Access 2013 is a relational database integrated with a graphical user interface tool that allows you to manipulate data with more flexibility than a two-dimensional spreadsheet program like Excel. Information in Access is stored in tables, which are often joined and then queried for subsets and combinations of the information they contain.

Advertisement

Input Masks and Data Validation are tools that prevent data entry that doesn't follow the rules set for a specific database. Input Masks are used for uniform entry of data like dates, times, and social security and phone numbers. Email addresses vary widely and require a Data Validation rule, which allows data to be entered in a more flexible format than an Input Mask.

Video of the Day

Advertisement

Video of the Day

Creating a Validation Rule for Email Fields

Step 1

In any open table, click the "View" button in the Ribbon and navigate to "Design View." All validation rules must be set in the Field Properties of your table, which are not available in the "Datasheet View."

Advertisement

Create an Email field, if you haven't already, and ensure the Data Type is "Text," or "Hyperlink" if you need the email address to be actively linked.

Step 2

Toggle to the Field Properties using "F6" and navigate to "Validation Rule." To ensure all previous changes are saved, click the "Save" button before entering your validation rule.

Advertisement

Step 3

Copy the following rule into the Validation Rule field:

Is Null OR ((Like "?@?.?") AND (Not Like "[ ,;]*"))

This text string sets the requirement that email addresses are formatted with characters separated by an "@" sign.

Advertisement

Advertisement

Step 4

In the "Validation Text" field, enter the text that displays if someone fails to enter an email address, or enters one in an incorrect format. Sample validation text:

"Please submit your email address with an '@' sign and domain name such as '[email protected].'"

Advertisement

Although the "Validation Text" field is optional, entering your own text prevents a generic or confusing message from displaying when errors occur.

Step 5

Always save your work when entering or exiting "Design View" unless you made a mistake and wish to exit the view without saving it. Access automatically prompts you to "Save" when changing views.

Advertisement

Advertisement

references & resources