autonumber question

J

JohnE

This is a general question regarding the autonumber. Is
it possible to customize the autonumber to say:
1) have is start at a different number?
2) have it include letters
I ask because it was asked if there could be some
automatic custom numbering done for the records. My
first thought is there is no control over the autonumber.
Is there a way to alter the autonumber?
Thanks.
*** John
 
D

Dirk Goldgar

JohnE said:
This is a general question regarding the autonumber. Is
it possible to customize the autonumber to say:
1) have is start at a different number?
Yes.

2) have it include letters
No.

I ask because it was asked if there could be some
automatic custom numbering done for the records. My
first thought is there is no control over the autonumber.
Is there a way to alter the autonumber?
Thanks.

Although it is possible to set the initial value for an autonumber, you have
very little control over it and it will not, as a rule, behave the way you
want. The common solution is to use your own procedure for generating a
custom number. If you're working in a single-user database, this can be as
simple as looking in the table to find the last number that was used so far,
then adding 1 to it for the next record. If you're working in a multiuser
database, one commonly has a one-record table in which you store the "next
free number". Then your custom-autonumber routine opens a recordset on that
table, locking it in the process, gets the number for use, then increments
the "next number" and saves it back to the table, freeing the table again.
 
Top