Others

Fix the Missing Primary Key Command in Microsoft Access

Algirdas JasaitisAlgirdas Jasaitis Nov 27, 2026 869 views

Question details

The user needs to find the Primary Key command and choose an appropriate primary key for an Access table.

Fix the Missing Primary Key Command in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
The user is designing a table and wants to set a field or fields as the primary key.
Observed behavior
The Primary Key command is missing from the shortcut menu, potentially because no field is selected or the table is not open in Design view.
Before you start

Open the database and identify the table you want to edit. Decide whether an existing field has unique values or whether you need a new AutoNumber ID field.

Solution 1Recommended

Set the primary key from the Access ribbon

Use Table Design view and the ribbon when the command is missing from the shortcut menu.

1
Open Design view

In the Navigation Pane, right-click the table and select Design View.

2
Select a key field

Click the row selector to the left of the field you want to use. To create a composite key, hold Ctrl and select each required field row.

3
Set the primary key

On the Table Design tab of the ribbon, click Primary Key. A key icon should appear beside the selected field or fields.

4
Save the table

Click Save on the Quick Access Toolbar or press Ctrl+S. If Access reports duplicate or invalid values, correct them before saving the key.

Set the primary key from the Access ribbon
Choose a reliable key: Personal names are not necessarily unique. An AutoNumber field such as MemberID is usually a better primary key than a first-and-last-name combination.
Free Microsoft Office alternative

Use WPS Office for Everyday Document and Spreadsheet Work

WPS Office is a free, lightweight alternative with a familiar interface and compatibility with common Microsoft Office formats, making it easy to move everyday documents and spreadsheets. It does not replace Access or fix Access database commands.

Work with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar ribbon-style interface for everyday office tasksOrganize tabular data in WPS Spreadsheets alongside your database workflowOpen and edit common Office files without changing your everyday workflow
microsoft office alternative - wps office

Frequently Asked Questions

Where is the Primary Key button in Access?

Open the table in Design View, select a field row, and click Primary Key on the Table Design ribbon.

Why is Primary Key missing from the right-click menu?

The table may not be in Design view, or no field row may be selected. Open Design View and select the row selector beside a field, then use the ribbon button.

Can I use first and last names as a primary key?

A composite key is possible, but names can be duplicated and are usually a poor choice. Consider an AutoNumber ID instead, and add a unique index on the name fields only if your rules require distinct combinations.

Why won't Access save my primary key?

A primary key must uniquely identify each record and cannot contain null values. Check the selected fields for duplicates or missing values, and ensure their data types are suitable for a key.