[ Team LiB ] Previous Section Next Section

Setting the Primary Key

graphics/02inf24.jpg

graphics/one_icon.jpg

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.

graphics/two_icon.jpg

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

graphics/three_icon.jpg

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.

INTRODUCTION

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.

TIP

AutoNumber

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

    [ Team LiB ] Previous Section Next Section