[ Team LiB ] Previous Section Next Section

Validating Field Values

When you need explicit control over data entered in a field, such as a range of numbers or dates, you can enforce a validation rule, which causes Access to test values a user enters in a field. If the value doesn't satisfy the validation rules criteria, Access refuses to enter the value and displays an error message. You can specify the text of the error message yourself. You can use the Expression Builder to create a validation rule by selecting the functions, constants, and operators you need for your rule from a list of options.

Create a Validation Rule

graphics/1_icon.jpg

Display the table in Design view, and then click a field that you intend to validate.

graphics/2_icon.jpg

Click the Validation Rule box, and then click the Build button to open the Expression Builder.

graphics/3_icon.jpg

Create an expression by clicking the appropriate elements in the Expression Builder dialog box.

graphics/4_icon.jpg

Click OK.

graphics/04inf19.jpg

Specify Validation Text

graphics/1_icon.jpg

Display the table in Design view, and then click a field.

graphics/2_icon.jpg

Click the Validation Text box.

graphics/3_icon.jpg

Type the text that Access will display when the user tries to enter incorrect data for the field.

graphics/04inf20.jpg

    [ Team LiB ] Previous Section Next Section