0.Restrict data input by using a validation rule
Expressions for Numbers
The value must be 42.
The value must be less than 100.
Less than or equal to
The value must be less than or equal to 100.
The value must be greater than 0.
Greater than or equal to
The value must be greater than or equal to 0.
Not equal to
The value can be anything except 42.
Greater than X and less than Y
>10 and <20
The value must be greater than 10 and less than 20. 10 and 20 are not included.
BRING TEXTBOOK TOMORROW
Between 0 and 100
The value must be 0, 100, or somewhere in between.
>=0 and <=100
Expressions for Dates and Times
The date occurs before January 30, 2012.
The date occurs after January 30, 2012.
Between #1/10/2013# and #31/10/2013#
The date occurs on October 2010.
Greater than the current date
The date occurs today or after.
Less than the current date
The date occurs yesterday or before.
Greater than the current date (and time)
The date occurs today after the current time, or any day in the future.
Less than the current date (and time)
The date occurs today before the current time, or any day in the past.
Note: You have to write Full date.
Expressions for Text
With text, validation lets you verify that a value starts with, ends with, or contains specific characters. You perform all these tasks with the Like operator, which compares text to a pattern.
The asterisk (*) represents (zero or more) characters. Thus, the complete expression asks Access to check that the value starts with R (or r), followed by a series of zero or more characters.
The text must start with the letter R.
The text must end with the letters ed.
requires that number 5 appears somewhere in a text field
You can use the wildcard (?) to match a single character, which is handy if you know how long text (field Size) should be or where a certain letter should appear
eight-character product code that ends with 0ZB
Entry must be 8 characters and end with the characters "0ZB".
Five-character code that begins with A.
Entry must be 5 characters and begin with the letter "A".
ORYou can use the or keyword to...