Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumber Problem

Status
Not open for further replies.

cyberdyne

Programmer
May 1, 2001
173
IN
Hi all,

I am trying my hand in access for recent times only.

I made a table which contains a srno. field which is set to be autonumber. Every thing is working nice but the problem is that while developing this small package i tried lot many times entering data an the emptying them.

Now the problem is that Autonumber field is showing the nos from 1 to 52 in that sequence and then it shows 96, 97 and so on.

I want to know if there is any way to reset the nos. so that I can start all over again ?

reply ASAP.
Thanks in advance. From:
Apoorva Gala
You can mail me at apoo1972@rediffmail.com
 
If you delete all the records in that table then compact the database the numbers will start from 1 again

Cheers
 
There is NO valid reason for resetting an autonumber field.

The purpose (and only purpose) of an autonumber field is to provide a unique identifier for a primary key field to allow the establishment and maintenance of relationships between tables (remember Access is a relational database).

So deleting or otherwise changing the autonumbers means you have lost your relationships.

If you need to do record counts or provide a sequential numbering of something like purchase orders, then there are other much more suitable methods than using an autonumber.

Cheers, Bill
 
Hi all thanks for reply.
I got the answer from one of the thread in tek-tip.

This is what I did and was successful.

I deleted the srno. column with Autonumber.
The from tools menu run the compact the database utility.
After that again I created the srno field with autonumber.
It created the appropriate and correct srno. for each entry.

There was no need to delete all records.

Thanks.
From:
Apoorva Gala
You can mail me at apoo1972@rediffmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top