MS Access

Requiring Data Entry

In most tables, there are usually at least a few fields that absolutely must contain data in order for the record to be meaningful.

For example, at the absolute minimum, a customer record needs to have the customer's first and last nameotherwise, why bother entering it? You can specify that a field must contain data to prevent users from leaving out important information when they are entering data.

The Required field property

This lesson explains how you can make sure that a field has a value for each record.

  1. Switch to Design view by clicking the View button on the toolbar.

    You decide to specify that the LastName field must contain data for each record.

  2. Click the LastName field.

    Here's how to prevent a user from leaving out data in a field.

  3. Click the Required list arrow and select Yes, as shown in figure.

    Let's see how the new default value works.

  4. Click the Save button on the toolbar to save your changes, click No to close the message about testing existing data, and then click the View button to display the table in Datasheet view.

    You will need to add a new record in order to see any default values.

  5. Click the New Record button on the Record Navigation bar.

    Access adds a new blank record to the table.

  6. Enter a new record with your own information. Leave the LastName field blank, however.

    Let's see what happens...

  7. When you have finished entering the record, click in any other record or press Ctrl + Enter to save the record.

    Access displays a dialog box that states that the LastName field cannot contain a null value.

To require data entry for a field:

  1. make sure the table is displayed in design view and click the field you want to require data entry for.

  2. click the required box in the field properties section.

  3. click the list arrow and select yes.