Microsoft KB Archive/223216

= ACC2000: No Primary Key on Copied or Imported Table in Access Project =

Article ID: 223216

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q223216



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access project (.adp).



SYMPTOMS
When you copy and paste or import a table that contains a primary key to a Microsoft Access project, no primary key is created on the resulting table.



RESOLUTION
You must re-create the primary key on the copied or imported table manually. To do so, follow these steps:
 * 1) Select the table in which you want to create a primary key and open it in Design view.
 * 2) Select the row that describes the field on which you want to create the primary key.
 * 3) On the Edit menu, click Primary Key. After a moment, a key icon should appear next to the row that you selected.
 * 4) On the File menu, click Save to save your changes.



Steps to Reproduce Behavior

 * 1) Open Microsoft Access.
 * 2) On the File menu, click Open.
 * 3) In the Open dialog box, select NorthwindCS.adp and click Open.
 * 4) In the Database window, click Tables under Objects, and then select Employees.
 * 5) On the Edit menu, click Copy.
 * 6) On the Edit menu, click Paste.
 * 7) In the Table Name box, type Employees2 . Under Paste Options select Structure and Data, and then click OK.
 * 8) Open the Employees table in Design view and note the primary key on the EmployeeID column.
 * 9) Open the Employees2 table in Design view and note there is no primary key on the EmployeeID column.

