• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Creating and Working with Sim... > Testing Validation Rule Changes

Testing Validation Rule Changes

You learned in Chapter 4, “Creating Your Database and Tables,” how to define both field and table validation rules. You also learned in Chapter 5, “Modifying Your Table Design,” that you can change these rules even after you have data in your table. Access warns you if some of the data in your table doesn’t satisfy the new rule, but it doesn’t tell you which rows have problems.

Checking a New Field Validation Rule

The best way to find out if any rows will fail a new field validation rule is to write a query to test your data before you make the change. The trick is you must specify criteria that are the converse of your proposed rule change to find the rows that don’t match. For example, if you are planning to set the Required property to Yes or specify a Validation Rule property of Is Not Null on a field (both tests mean the same thing), you want to look for rows containing a field that Is Null. If you want to limit the daily price of a room to <= 90, then you must look for values that are > 90 to find the rows that will fail. Another way to think about asking for the converse of a validation rule is to put the word Not in front of the rule. If the new rule is going to be <= 90, then Not <= 90 will find the bad rows.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint