ACC2002: Using the "Create Table by Entering Data" Option Starts Primary Key Field at 22 Instead of at 1 (275084)
The information in this article applies to:
This article was previously published under Q275084 Novice: Requires knowledge of the user interface on single-user computers.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS
If you use the Create table by entering data option to create a table, the primary key field begins with a value of 22 instead of the expected value of 1.
CAUSE
You see this behavior when you save the table without entering any data, and you then click Yes when you are prompted to create a primary key.
RESOLUTION
If you have not entered much data, you can delete the existing records, compact the database, and then enter the records again. Compacting the database when the table does not contain any records resets the primary key value to 1.
If you have already entered a lot of data, use the following steps to create a new table and to move the existing data into the new table with a new primary key starting at 1. IMPORTANT: The following steps create a new primary key. You should not follow these steps if you have used the primary key in a relationship to another table. - In the Database window, select the table that contains the primary key field that starts at 22.
- On the Edit menu, click Copy.
- On the Edit menu, click Paste.
- In the Table Name box, type a name for a new table. Under Paste Options, click Structure Only, and then click OK.
- In the Database window, click Queries under Objects, and then double-click Create query by using wizard.
- Click the arrow in the Tables/Queries box, and then click the table that has the primary key that starts at 22. Move all fields except ID, the primary key field, to the Selected Fields list. Click Next.
- Click Modify the query design, and then click Finish.
- On the Query menu, click Append Query.
- Click the arrow in the Table Name box, click the table that you created in step 4, and then click OK.
- On the Query menu, click Run. Click Yes when you are prompted to append the records.
After you confirm that the new table contains the correct records, you can delete the original table.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | kbnofix kbprb KB275084 |
---|
|