changing autonumber starting number

Z

Zodiacal

is there a way to change the autonumber to start at a number lower than the
max number in the field?
if not i am so screwed.
 
V

Van T. Dinh

Sorry, you are screwed <smile> if you are talking about incremental
AutoNumber (but if you were using Random AutoNumber, you wouldn't have
asked this question).

OTOH, you are using AutoNumber incorrectly. The *only* purpose of
AutoNumber is to provide (almost-guaranteed) uniqueness to each Record and
the actual value assigned to each Record shouldn't matter. My users don't
even ever see the values of the AutoNumber Field.
 
A

Ashby

I would need more information about what you're try to
accomplish. However...
If there are existing records in a table access will
starting numbering from the highest number.

Three possible scenarios:

(1) If you purpose is to reset the autonumber to start at
1, then you will need to delete all the records from the
table and compact the database.

(2) If you have existing records that have lower numbers
and you want to get them into another table that has an
autonumber. I suggest you append them. As long as there
are no duplicate records this should work.

(3) If you have existing records without any numbers.
Create a duplicate table of the one you want to append
into. Set the autonumber field in this duplicate table to
start at whatever number you want (see Access help), then
append the records into this duplicate table; and then
append into the primary table.

It is possible, but it may require some work.
 
R

Rick Brandt

Zodiacal said:
is there a way to change the autonumber to start at a number lower than the
max number in the field?
if not i am so screwed.

The standard line is...

If you care about the value in any way other than uniqueness, then don't use an
AutoNumber.
 
V

vseale

Is the problem that the autonumber has reset itself? If
so, I share your pain. My table periodally resets itself
to a new value. I found a longterm solution this morning
in another newsgroup. Download Jet 4.0 SP 7. For the
immediate fix to resync the autonumber back to the right
number I do the following about every other month -
-do a make-table table to remove the out-of-sync records
to a hold table and delete from the main table
-create a temp table with one field as a number field
a. name the field the same as the auto-number field in
main table
b. put in the value you want to reset to -1 (ex: the
last correct autonumber is 128, so set the temp table to
128)
-do an append-query with the temp table appending to the
main table
-do an append-query with the hold table (not including
autonumber field) to the main table

This will get you back in sync. Good luck!
 

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

Similar Threads


Top