Dear All
I have a table with an autonumber field. This field generates auto numbering like 1,2,3,4,5.... etc.
I wish to customize this result like B-001, B-002, B-003....etc.
Is it possible ? If yes then how? Please help me.
Thanks.
Dear All
I have a table with an autonumber field. This field generates auto numbering like 1,2,3,4,5.... etc.
I wish to customize this result like B-001, B-002, B-003....etc.
Is it possible ? If yes then how? Please help me.
Thanks.
The only way to do this is to use a manual primary key which I nearly always try and avoid.
For your example you would use a text field of length 5 and set it as the primary key.
You'd then need to write some validation to validate the input of the key and some code to generate the key.
In the tables auto number field go to format and type: B-000
You can't change the Autonumber type field. You should understand what an autonumber is:
See:
Autonumbers--What they are NOT and What They Are
http://www.utteraccess.com/wiki/index.php/Autonumbers
Microsoft Access Tables: Primary Key Tips and Techniques
http://www.fmsinc.com/free/newtips/primarykey.asp
Use Autonumbers properly
http://access.mvps.org/access/general/gen0025.htm
But you can create a custom autonumber http://www.baldyweb.com/CustomAutonumber.htm
(I would still keep the autonumber field type)