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

ID: Q223216


The information in this article applies to:

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.



MORE INFORMATION

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.



REFERENCES

For more information about creating primary keys, click Microsoft Access Help on the Help menu, type "defining a primary key" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Additional query words: prb


Keywords          : kbdta AccessCS 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 13, 1999