5/15/11

How to Ensure Data Is a Certain Length in Microsoft Access 97

Microsoft Access 97 includes validation rules to reduce accidental and intentional errors. One way you can reduce error is to validate lengths of fields in the database table. The settings you add to the fields in your database are also applied to forms and queries.
    • 1

      Open the database you want to modify in Access 97. Select the "Tables" tab in the Database window.

    • 2

      Double-click the table you want to open and select the "Design View" button in the upper left corner.

    • 3

      Click the field name that contains the field you want to validate and go to the "Properties" section in the bottom pane.

    • 4

      Set "Allow Zero Length" under the "General" tab to "No" to ensure the field is not empty.

    • 5

      Set the "Field Size" to the maximum number you ant the field to be.

    • 6

      Set "Validation Rule" to the number of characters, represented by question marks, that are accepted. To allow users to enter no more than five characters in a particular field, type the following, including the quotes and the word, "Like":

      Like "?????"

    • 7

      Click the "Save" button to save your validation rules.

  • No comments: