How to Update the Primary Key Field
The primary key in a database table gives each record its own personal identifier that does not match in any other way with any of the other records. This guarantees the integrity of the data in the database. Records do not get mixed up outside of human error. When you update the primary key category within a database it changes by what the record is searchable and locatable. Microsoft Access 2007 has checks and balances in it to keep you from duplicating the information entered into the primary key fields.
Instructions
-
-
1
Open Microsoft Access 2007. Click the round button in the upper, left of the screen containing the Windows log and choose "Open." A pop-up box will appear. Navigate to the location of your database file, click on it and click "Open."
-
2
Click on the "Design View" tab in the upper menu choices along the top of the screen. Click on the "Table" window to display a listing of your database categories. Your current primary key is displayed with a picture of a "key" to the left of it.
-
-
3
Click on your primary key category. Navigate to the "Design" tab along the top of the screen and press the "Primary Key" icon in the upper, left-hand corner. This removes the current primary key assignment.
-
4
Navigate back down to the listing of database categories. Click on the blank box to the left of the row you want the new primary key to be. Click the "Primary Key" icon above to update your primary key.
-
5
Navigate back to the top of the screen and click on the round button in the upper, left-hand corner with the Windows logo and choose "Save As." Make sure your file is still located in the correct place within the new pop-up window and click "Save."
-
1
Tips & Warnings
If you want to rename the name of the category of the primary key without changing its assignment, click on the box to the right of the "key" icon under the "Field Name" column. Backspace through the contents and choose a new name. Save your work when you finish.
Microsoft Access does not force you to have a primary key within a database; however, it will assign the "ID" field as a default primary key field for all new database tables you create. If you do not want this "ID" field to be your primary key, you will need to unassign it as the primary key or rename its "Field Name."
References
- Photo Credit database on paper image by .shock from Fotolia.com