Setting AutoNumber back

E

Ed P.

hello, I currently have a table that has an AutoNumber field. I added some data to it so that I could test the queries and such. Now I have deleted all records from the table but the AutoNumber field does not go back to 1, it continues with what would have been a new row using the old data that I had on it previously. Can Anyone tell me how to set the AutoNumber back to 1 (or whatever the default is to start at 1).

thanks
 
S

Sal Rosario

Tools...Database Utilities...Compact and Repair

--
Sal Rosario
Database Consultant
www.salrosario.com


Ed P. said:
hello, I currently have a table that has an AutoNumber field. I added
some data to it so that I could test the queries and such. Now I have
deleted all records from the table but the AutoNumber field does not go back
to 1, it continues with what would have been a new row using the old data
that I had on it previously. Can Anyone tell me how to set the AutoNumber
back to 1 (or whatever the default is to start at 1).
 
J

Jeff Boyce

Ed

Why? As in "why does it matter what value the Autonumber has?" Access
Autonumbers are intended to be (generally unique) row identifiers, and
seldom need to be shown to users.
 
E

Ed P.

Hello Jeff, the reason why I want to do this is because when I delete the data the autonumber automatically puts in a number such as 127...this corresponds to the fact that I had 126 records on the table before deleting the data on the table. I just wanted to start over since all of the data I had entered before was only done to make sure that the table met all of the requirements for my data. I want the new rows to begin with 1 as the autonumber and increment as needed

By the way, thanks Sal your advice worked!
 
J

Jeff Boyce

Ed

I'll assume to interpret Tim's reply -- you DON'T use Autonumber to count
the records (that's what queries are for). And you don't use the Navigation
information to sequence/count (that's what queries are for). And you don't
want to use Autonumbers as anything other than a "behind the curtain" row
identifier (if you believe the general consensus of this newsgroup).
 

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