Every table in a relational database should have a primary key. Telling Access 2007 how to define the primary key is quite simple. Open the table in Design view and click the row selector to the left of the field you want to use as the primary key. If you need to select multiple fields for your primary key, hold down the Ctrl key and click the row selector of each additional field you need.
For details about designing primary keys for your tables, see Article 1, “Designing Your Database Application,” on the companion CD.
After you select all the fields you want for the primary key, click the Primary Key button in the Tools group of the Design contextual tab on the Ribbon. Access 2007 displays a key symbol to the left of the selected field(s) to acknowledge your definition of the primary key. To eliminate all primary key designations, see “Adding Indexes” on page 188. When you’ve finished creating the Companies table for the Contact Tracking database, the primary key should be the CompanyID field, as shown in Figure 4–22.
Figure 4–22: You can easily define the primary key for the Companies table by selecting the field in Design view and clicking the Primary Key button on the Ribbon.
Be sure to click the Save button on the Quick Access Toolbar to save this latest change to your table definition.