Note: When you create a new table in Datasheet view, Access automatically creates a primary key for you and assigns it the AutoNumber data type.
-
In Access, open the database that you want to modify.
-
In the Navigation Pane, right-click the table to which you want to add the primary key, and click Design View.
Tip: If you don't see the Navigation Pane, press F11 to display it.
-
Locate the first available empty row in the table design grid.
-
In the Field Name field, type a name, such as CustomerID
-
In the Data Type field, click the drop-down arrow and click AutoNumber.
-
Under Field Properties, in New Values, click Increment to use incrementing numeric values for the primary key, or click Random to use random numbers.
When you create a new table in Datasheet view, Access automatically creates a primary key for you and assigns it the AutoNumber data type.