Microsoft Office Tutorials and References
In Depth Information
Figure 5-41
Validation properties for the Zip field
current field
validation properties
You can now save the table design changes and then test the validation properties.
4. Save the table, and then click the Yes button when asked if you want to test the
existing Zip field values in the tblCustomer table against the new validation rule.
Access tests the existing records in the tblCustomer table against the validation rule. If
any record violates the rule, you are prompted to continue testing or to revert to the
previous Validation Rule property setting. Next, you’ll test the validation rule.
5. Switch to Datasheet view, and then scroll the table to the right until the Zip field is
visible.
6. Double-click 49341 in the first row’s Zip field text box, type 54321 , and then press
the Tab key. A dialog box opens containing the message “Michigan zip codes must
be between 48000 and 49999,” which is the Validation Text property setting you
created in Step 3.
7. Click the OK button, and then press the Esc key. The first row’s Zip field value
again has its original value, 49341.
8. Close the tblCustomer table.
Now that you’ve finished entering the field validation rule for the Zip field in the
tblCustomer table, you’ll enter the table validation rule for the date fields in the
tblContract table.
Defining Table Validation Rules
To make sure that a user enters a SigningDate field value in the tblContract table that
is chronologically earlier than the record’s StartDate field value, you can create a table
validation rule that compares one field value in a table record to another field value in
the same record to verify their relative accuracy. Once again, you’ll use the Validation
Rule and Validation Text properties, but this time you’ll set these properties for the table
instead of for an individual field.
You’ll now set the Validation Rule and Validation Text properties to compare the
SigningDate and StartDate field values in the tblContract table.
Search JabSto ::




Custom Search