On 13 Oct 2003 13:06:51 -0700,
si****@omantel.net.om (Prakash Wadhwani) wrote:
wat if i'd like the autonumbering to start (begin) from a a particular
number. Is there any way to do it ?
Best Rgds,
Prakash
Clear the data of any existing records.
Append a single record to the table with the a value one less than your start number. You must use an append query to do this.
Compact the database.
Delete the temporary record.
The first record entered will have an autonumber value equal to your start value.
That said it is very bad practice to use an autonumber to control sequential numbering as you will quickly develope gaps in the numbering sequence.
eg If a use starts a new record but presses escape and does not the complete the record, the autonumber assigned to the new record will be discarded
and NOTreused. Therefore the next new record created will NOT be in sequence.
A far better solution is to use a Long Integer field and use Nz(DMax("MyID","tblMyTable"))+1 to determine the next available sequential number.
If you want to set a specific starting number using this method, set the last argument of the Nz function to one less than your starting number. eg to
start at 1000 use Nz(DMax("MyID","tblMyTable"),999)+1
If the new record is the first record entered in the table, 1000 will be assigned, From then on the value will increment by 1.
Wayne Gillespie
Gosford NSW Australia