Chapter 2: Creating Access Tables
55
field description can help clarify a field whose purpose is ambiguous or give the user a more com-
plete explanation of the appropriate values for the field during data entry.
Creating tblCustomers
Working with the different data types, you should be ready to create the final working copy of
tblCustomers. When creating the table, you must add a field that is used to link this table to
two other tables (tblSales and tblContactLog) in the Collectible Mini Cars application.
Using AutoNumber fields
Access gives special considerations to AutoNumber fields. You can’t change a previously defined
field from another type to AutoNumber if any data has been added to the table. If you try to
change an existing field an AutoNumber, you’ll see an error that says
Once you enter data in a table, you can’t change the data type of
any field to AutoNumber, even if you haven’t yet added data to
that field.
You’ll have to add a new AutoNumber field and begin working with it instead of changing an
existing field to AutoNumber.
Note
Only one AutoNumber field can be added to an Access table. Generally speaking, it’s better to use
AutoNumber fields where their special characteristics are needed by an application.
Completing tblCustomers
With tblCustomers in Design view, you’re ready to finalize its design. Table 2.1, shown earlier
in this chapter, lists the field definitions for tblCustomers. Enter the field names and data types
as shown in Table 2.1. The next few pages explain how to change existing fields (which includes
rearranging the field order, changing a field name, and deleting a field).
Here are the steps for adding fields to a table structure:
- Place the cursor in the Field Name column in the row where you want the field to
appear. - Enter the field name and press Enter or Tab to move to the Data Type column.
- Select the field’s data type from the drop-down list in the Data Type column.
- If desired, add a description for the field in the Description column.
Repeat each of these steps to create each of the data entry fields for tblCustomers. You can press
the down-arrow (↓) key to move between rows, or use the mouse and click on any row. Pressing F6
switches the focus from the top to the bottom of the table design window, and vice versa.