---
title: "Validation rules in Access"  
description: "In this article I have explain how to add validation rules in an Access table. Using validation rules, you can check what users can enter in a given f"  
author: "AVADHESH PATEL"  
published: 2013-04-01  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/1183/validation-rules-in-access  
category: "ms access"  
tags: ["ms access"]  
reading_time: 3 minutes  

---

# Validation rules in Access

In this [article](https://yourviews.mindstick.com/view/81489/kashmir-now-after-an-year-of-abrogation-of-article-370) I have [explain](https://www.mindstick.com/forum/159699/what-is-a-compilation-error-in-dot-net-core-explain-with-an-example) how to add [validation rules](https://www.mindstick.com/interview/34052/custom-validation-rules-and-validation-messages-in-knockout) in an [Access table](https://www.mindstick.com/forum/159844/dynamically-access-table-in-entity-framework-core-2-0). Using validation rules, you can check what users can enter in a given field. Validation rules prevent bad data being saved in your table. Implementing validation rules in Access, steps are given below.\

Step 1: First create a table in your [access database](https://www.mindstick.com/forum/385/access-database-datatype-problem) as below image for demonstration.

##### Figure 1:

![Validation rules in Access](https://www.mindstick.com/mindstickarticle/3f726d6f-3869-4c63-92a4-e99a826fcef7/images/18814352-bdb2-4da5-9e98-7ecdaf60c60c.png)

Step 2: Apply validation rule on “Name” column as below image. Here I have validated “Name” column that accept only “a-z or A-Z” character only.

Validation Rule: - Is Null OR Not Like "*[!a-z]*"

Validation Text: - Accept letters (a - z) only

##### Figure 2:

![Validation rules in Access](https://www.mindstick.com/mindstickarticle/3f726d6f-3869-4c63-92a4-e99a826fcef7/images/a3f6ee64-f9b6-431f-9896-a64549c855e9.png)

Step 3: Now when you try to enter wrong value into “Name” column that will be [display alert](https://www.mindstick.com/forum/175/display-alert-on-window-load-in-javascript) [message](https://www.mindstick.com/interview/682/which-are-the-various-message-map-macros) as below image.

##### Figure 3:

![Validation rules in Access](https://www.mindstick.com/mindstickarticle/3f726d6f-3869-4c63-92a4-e99a826fcef7/images/1f71fc1b-e93b-4f03-95b2-b22a67eef024.png)

Step 4: Below I have given some important validation which frequently used

| ##### S. No. | ##### Validation Rules | ##### Description |
| --- | --- | --- |
| ## 1 | Is Null OR Not Like "*[!a-z]*" | Accept letters (a - z) only |
| ## 2 | Is Null OR Not Like "*[!0-9]*" | Accept digits (0 - 9) only |
| ## 3 | Is Null OR Not Like "*[!((a-z) or (0-9))]*" | Digits and letters only |
| ## 4 | Is Null OR Like "????????" | Exactly 8 characters |
| ## 5 | Is Null OR Between 1000 And 9999 | Exactly 4 digits |
| ## 6 | Is Null OR Like "####" | Exactly 4 digits |
| ## 7 | Is Null OR >= 0 Remove | Positive numbers only |
| ## 8 | Is Null OR Between -1 And 1 | No more than 100% |
| ## 9 | Is Null OR <= Date() | Not a future date |
| ## 10 | Is Null OR ((Like "*?@?*.?*") AND (Not Like "*[ ,;]*")) | Email address |
| ## 11 | Not Null | You must fill in Field1 |
| ## 12 | Is Null OR "M" Or "F" | Limit to specific choices as Male/Female |
| ## 13 | Is Null OR IN (1, 2, 4, 8) | Limit to specific choices |
| ## 14 | Is Null OR 0 or -1 | Yes/No/Null field |

---

Original Source: https://www.mindstick.com/articles/1183/validation-rules-in-access

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
