Start Table ID count over to 1?

E

espee2

Is there a way to start the count of a table ID back to 1 (one) It
would be nice if there was, I am learning and when I experiment around
with a table and enter some records and delete them of course the ID
count goes up. Also if I copy that table/database for a friend, his
count starts (not at 1)
 
E

espee2

Is there a way to start the count of a table ID back to 1 (one) It
would be nice if there was, I am learning and when I experiment around
with a table and enter some records and delete them of course the ID
count goes up. Also if I copy that table/database for a friend, his
count starts (not at 1)

Never mind I figured it out
 
D

Douglas J. Steele

Glad you got it working, but be aware that you should have needed to.

You should never attach any significance to the value of an autonumber
field. Autonumber fields exist for one purpose, and one purpose only: to
provide a (practically guaranteed) unique value that can be used as a
primary key. The values 356, 358, 359 serve that purpose just as well as 1,
2, 3.

In fact, it's common to hide the value of the autonumber field from users,
as they sometimes get concerned with there are gaps in the numbering (which
is practically guaranteed to be the case)

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
Co-author: "Access 2010 Solutions", published by Wiley
(no e-mails, please!)



Is there a way to start the count of a table ID back to 1 (one) It
would be nice if there was, I am learning and when I experiment around
with a table and enter some records and delete them of course the ID
count goes up. Also if I copy that table/database for a friend, his
count starts (not at 1)

Never mind I figured it out
 
J

John W. Vinson

Is there a way to start the count of a table ID back to 1 (one)

No, because a table doen't HAVE a "Count". You can dynamically count the
records in a totals query, or view a Tabledef object's Count property, but if
you're assuming that an Autonumber field is a reliable "count" property you
will be disappointed; autonumbers will always develop gaps, and should *not*
be treated as if they were a count, or gapless, or sequential. That's not
their purpose, which is *only* to provide a meaningless unique key.
 

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