DBWebApplications 





Access Queries  «Prev 
Setting up validation for fields

Showing the Validation Rule property

Validation rules prevent bad data being saved in your table. Basically, they look like criteria in a query.
You can create a rule for a field (lower pane of table design), or for the table (in the Properties box in table design.) Use the table's rule to compare fields.
There is one trap to avoid. In some versions of Access, you will not be able to leave the field blank once you add the validation rule, i.e. you must enter something that satisfies the rule. If you need to be able to leave the field blank, add OR Is Null to your rule.
Some versions accept Nulls anyway, but we recommend you make it explicit for clarity and consistency.


You open the table you want to modify in Design mode
You open the table you want to modify in Design mode

Place the cursor in the field to be modified
Place the cursor in the field to be modified


Enter the desired criteria in the line for the Validation Rule property
Enter the desired criteria in the line for the Validation Rule property