Primary Key

S

Steve Schapel

Open a new query in design view. In the first column of the query
design grid, type 9999 and then make this an Append Query (select Append
from the Query menu) and set it up to add to the Autonumber field in
your table. If you have any other fields in the table with Validation
Rules, or their Required property is Yes, you will need to cater to
these as well. Run the query. The next record added to the table
should show 10000 in the autonumber field. You can delete the "bogus"
9999 record from the table.
 
K

Kyle

I've run the query, but why can I not get the autonumber sequence to start over once I have deleted records?
 
K

Kyle

....also

I deleted the query that started the sequence at 9999. The autonumber is still continuing to count by 10000's. Help!
 
S

Steve Schapel

Kyle,

Access doesn't work like that. If you delete *all* the records, and
then compact the database, the numbering will revert to start at 1
again. But deleting records will not allow those numbers to be re-used
(unless you insert them with an Append Query.

In general, the purpose of an Autonumber is to provide a unique
identifier for each record. As such, it shouldn't matter what the
number is. If you care what the number is, or if it's important to have
a numbering which is sequential, then you shouldn't be using an Autonumber.
 
S

Steve Schapel

Hmmm, thant's unusual. You mean the Autonumber is showing 10000, next
record 20000, then 30000 etc? Really? Never seen that before!
 

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