In this post, we demonstrate a couple of different ways to set the primary key in MS Access.
A Primary Key is defined as “a unique key that can uniquely identify each row in a table”. The actual Key itself can be an auto-generated ID number, a known unique number (such as a social security number) or even a text field. The only constraint is that the data be unique!
So, to set a primary key:
Open up an MS Access table in design view and highlight the ID field (if your table doesn’t have an ID field then create one!). In the Tools group of the ribbon you will see a big key icon with a label “Primary Key”. Click on this button.
Another way to add a primary key is to select a row by clicking on it and then right-click and choose the key icon.
Both of the above methods will produce the same result and adding primary keys will help your tables to be more robust as a result!
Related Posts
Adding Fields To A Table TablesField Data Types Tables
How To Create A New Table In Access Tables
How To Increment A Text ID Field Tables
Indexes Tables
Define primary key. What is the procedure of applying primary key MS Access?