Unique ID with Autonumber

R

Ray

Hello,

I'm not a developer but a general user without knowledge on access programming.
I'm currently working on a project with tables having different ID.
How can I use the autonumber function to create different IDs such as "L0001" or "D0001" with L and D putting in front of an autonumber representing different ID fields.

Please help.

Thx.
 
G

Graham R Seach

Ray,

Don't! The number created by an Autonumber datatype is system-generated, and
is not meant for human consumption. It's realy only there to provide an
incrementing surrogate key for tables. If you want something that has
meaning to humans, create and manage your own.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html


Ray said:
Hello,

I'm not a developer but a general user without knowledge on access programming.
I'm currently working on a project with tables having different ID.
How can I use the autonumber function to create different IDs such as
"L0001" or "D0001" with L and D putting in front of an autonumber
representing different ID fields.
 
U

user

I have done the same sort of thing where different copies of the same
database have been installed (in different locations) with the plan in mind
to combine the data down the road. So in each copy of the system the
primary key in a table is an autonumber with a prefix specific to that copy
(location).

Since Access autonumbers don't allow for characters it is best to make the
primary key based on two fields, one an autonumber and the other a constant
prefix that is different for each situation.

Doug M

Ray said:
Hello,

I'm not a developer but a general user without knowledge on access programming.
I'm currently working on a project with tables having different ID.
How can I use the autonumber function to create different IDs such as
"L0001" or "D0001" with L and D putting in front of an autonumber
representing different ID fields.
 
Top