Setting the Primary Key



After you've opened the table for which you want to set a primary key in Design view, click the field that you want to use as the primary key to select it.


Click the Primary Key button on the Standard toolbar in the main Access window.


Access adds a key icon to the field to indicate that it is the primary key. Click the Save button on the Standard toolbar in the main Access window to save your changes to the table.


To help ensure that each record in your table is unique, Access encourages you to create a unique ID field and to use this field as the table's primary key. The primary key helps with sorting, indexing, and other database functions. In your database, you should set up an ID-type field and then set this field as the primary key. This ID field might contain unique product numbers, Social Security numbers, or even an arbitrary AutoNumber field.



If you let Access create the primary key for you, it creates an AutoNumber field that is incremented for every new record you create.