Reset AUTONUMBER

G

Guest

How do I reset the value of an Autonumber field?
After I delete all the records from atable the auto number doesn't go back to
zero.

Thx
 
G

Guest

Hi eld,

Delete all the records then run a compact/repair on your database (the back
end, not the front end if it's split).

Damian.
 
J

Jeff Boyce

You posted in a "reports" newsgroup ... what does this have to do with
reports?

Why do you care what value an autonumber field has? Autonumbers are unique
row identifiers, and are generally unfit for human consumption. Are you
showing an autonumber to a user?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
G

Guest

You could also copy and paste the table that contains the the autonumber and
only select the copy the structure only option. This will make a second
copy of the table, but not copy the data in it, and in essence reset the
autonumber back to one.

Then if you want to keep your codes intact and have no more use for the old
table but would still like to keep the data, then you can rename the old
table. Afterwards rename the new table to the name that the old table had,
and all should flow correctly as before while still keeping the old data.

Hope this helps.
 
J

Jeff Boyce

Jean-Francois

A potential down-side of doing this is that the data integrity of any
related (child) tables that are relying on the value of this table's
(parent's) Autonumber ID field could be compromised when the parent table
"resets" its Autonumber.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top