Clear Database and Reset the AutoNumber

J

jillian.calderon

I know this isn't exactly about reports, but I suppose it's common
knowledge among those who use access. However, I don't know!

Good Morning Everyone,

I'm making a database and I'm playing with it using test data. When
I want to put the actual data in, how do I reset the autonumber back to
1? How do I tell the database to completely delete the fake records so
the autonumber doesn't start at, o, 50?

Thanks!
Jillian
 
J

Jeff Boyce

Jillian

Why do you care? An Access Autonumber is an arbitrary, supposedly-unique
row identifier, and is generally unfit for human consumption.

Your question implies that someone will be seeing the Autonumber and will
'want' it to start at "1" and increment by 1's. As soon as a record is
deleted, or started and cancelled, you won't have a sequential list of row
IDs.

If you need a guaranteed-sequential numbering system, you'll need to "roll
your own".

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Marshall Barton

I know this isn't exactly about reports, but I suppose it's common
knowledge among those who use access. However, I don't know!

Good Morning Everyone,

I'm making a database and I'm playing with it using test data. When
I want to put the actual data in, how do I reset the autonumber back to
1? How do I tell the database to completely delete the fake records so
the autonumber doesn't start at, o, 50?


First you should manually delete all of your test records
from all the tables. It's possible to write a VBA procedure
to automate this task, but it's usually not worth the effort
because you have to do it in the reverse order of the
relationships beterrn the tables (i.e. child tables first)

Once all the tables are empty, Compact the db to reclaim the
space used by the now deleted records. Compact will also
reset all autonumber fields.
 

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