CoolDudeeh
You can reset the autonumber, but please realize...
- Some want the to use the autonumber to "count" their records. This is not the purpose of the autonumber -- the purpose is to provide a simple method of applying a unique ID to a record, and fascilitate linking parent and child records.
- Autonumber is a long interger (4 bits), -2,147,483,648 to 2,147,483,647, or under certain conditions, as a unique replica ID (16 bits) -- quite a lot of records
- It can be incremented sequentially or randomly
And most importantly,
- If the autnumber is used as a foreign key to other tables, you may have a major conversion issue to address.
- Will you want to retain the existing records, or restart the autonumber with an empty table?
Lastly, you need to backup and backup. You are working with a primary key, and it sounds like a fair chunk of data.
To restart the autonumber
- Delete all records and then the run compact / repair utility
To restart at a fixed number
- Since this process involves writing a dummy record, for the table in question, tempararily
-- Disable primary key settings but leave the autonumber setting
-- Disable any settings for other fields in the table set for no duplicates, no nulls and validation rules (including referential integrity links to other tables)
- Create a temp table with only one field which will have the same name as the autonumber field in question. This field will have to be a long integer field type.
- In the temp table, enter a dummy record which has a number one less than the starting ID number you want to use. For example, if you want autonumber to start at 1000, then enter 999 in the single field.
- Use an append query to write the temp record with the long interger number that was entered to the table in question -- this record will be added to the autonumber field. The append query will be treated the new number without advancing the autonumber.
- Delete the temp table, and delete the dummy record that was appended the table in question
- Reset the primary key setting, and any fields changed earlier including any relationships
The next record to be entered will generate the autonumber you want to use.
Having rambled on this process, is this really what you want? Or do you have a data integrity issue?
Richard