Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access primary key

Forum home » Delegate support and help forum » Microsoft Access Training and help » Access primary key

Access primary key

ResolvedVersion Standard

Karen has attended:
Access Introduction course

Access primary key

our current database which contains over 7000 entries is now counting up incorrectly so where it may say in the bottom left counter 7000 it is in fact in the record saying 7006 - can this be resolved so it shows the correct and same record number in the count box and in the record?

RE: Access primary key

Hi Karen

Thank you for your question

If I understand you correctly your table has 7000 records, while the autonumber primary key field shows the last record as 7006.

This is most likely to be because records have been deleted from the table. If this happens access does not automatically recalculate the autonumbers, but will carry on from the last number enetered. So if you type in record number 1000 and then delete it. The next number entered would be 1001, leaving 1000 effectively blank.

To fix this you would need to click on tools-Database utilities-compact and repair.

Note this will recalculate the autonumber field

Hope this helps

Stephen

Access tip:

Compact database automoatically

To ensure optimal performance, you should compact and repair your

Open the Access database or Access project that you want Access to compact automatically.
On the Tools menu, click Options.
Click the General tab.
Select the Compact on Close check box.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.