validation rule

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

To do this ...

Validation Rule for Fields Explanation


To do this ... Validation Rule for Explanation
Accept letters Is Null OR Not Like "*[!a-z]*" Any character outside the range A to Z is Fields
(a - z) only rejected. (Case insensitive.) Accept letters (a - Is Null OR Not Like "*[! Any character outside the range A to Z is
Accept digits Is Null OR Not Like "*[!0-9]*" Any character outside the range 0 to 9 is z) only a-z]*" rejected. (Case insensitive.)
(0 - 9) only rejected. (Decimal point and negative sign Accept digits (0 - Is Null OR Not Like "*[! Any character outside the range 0 to 9 is
rejected.) 9) only 0-9]*" rejected. (Decimal point and negative
Letters and Is Null Or Not Like "*[!a-z OR Punctuation and digits rejected. sign rejected.)
spaces only "" ""]*" Letters and spaces Is Null Or Not Like "*[! Punctuation and digits rejected.
Digits and Is Null OR Not Like "*[!((a-z) Accepts A to Z and 0 to 9, but no only a-z OR "" ""]*"
letters only or (0-9))]*" punctuation or other characters. Digits and letters Is Null OR Not Like "*[! Accepts A to Z and 0 to 9, but no
Exactly 8 Is Null OR Like "????????" The question mark stands for one only ((a-z) or (0-9))]*" punctuation or other characters.
characters character. Exactly 8 Is Null OR Like "????????" The question mark stands for one
Exactly 4 digits Is Null OR Between 1000 For Number fields. characters character.
And 9999 Exactly 4 digits Is Null OR Between For Number fields.
Is Null OR Like "####" For Text fields. 1000 And 9999

Positive Is Null OR >= 0 Remove the "=" if zero is not allowed either. Is Null OR Like "####" For Text fields.
numbers only Positive numbers Is Null OR >= 0 Remove the "=" if zero is not allowed
No more than Is Null OR Between -1 And 1 100% is 1. Use 0 instead of -1 if negative only either.
100% percentages are not allowed. No more than 100% Is Null OR Between -1 100% is 1. Use 0 instead of -1 if negative
Not a future Is Null OR <= Date() And 1 percentages are not allowed.
date Not a future date Is Null OR <= Date()
Email address Is Null OR ((Like "*?@?*.?*") Requires at least one character, @, at least Email address Is Null OR ((Like "*?@? Requires at least one character, @, at
AND one character, dot, at least one character. *.?*") AND least one character, dot, at least one
(Not Like "*[ ,;]*")) Space, comma, and semicolon are not (Not Like "*[ ,;]*")) character. Space, comma, and semicolon
permitted. are not permitted.
You must fill Not Null Same as setting the You must fill Not Null Same as setting the
in Field1 field's Required property, but lets you in Field1 field's Required property, but lets you
create a custom message (in the Validation create a custom message (in
Text property.) the Validation Text property.)
Limit to specific Is Null OR "M" Or "F" It is better to use a lookup table for the Limit to specific Is Null OR "M" Or "F" It is better to use a lookup table for the
choices list, but this may be useful for simple choices list, but this may be useful for simple
choices such as Male/Female. choices such as Male/Female.
Is Null OR IN (1, 2, 4, 8) The IN operator may be simpler than Is Null OR IN (1, 2, 4, The IN operator may be simpler than
several ORs. 8) several ORs.
Yes/No/Null Is Null OR 0 or -1 The Yes/No field in Access does not support Yes/No/Null field Is Null OR 0 or -1 The Yes/No field in Access does not
field Null as other databases do. To simulate a support Null as other databases do.
real Yes/No/Null data type, use a Number To simulate a real Yes/No/Null data type,
field (size Integer) with this rule. (Access use a Number field (size Integer) with this
uses 0 for False, and -1 for True.) rule. (Access uses 0 for False, and -1 for
True.)

You might also like