D
DbMstr
I like to use AlphaNumeric(AN) IDs, (0-9 and A-Z) in a FIXED field
length especially if they will ever be viewed as concatenated with
another field. For example, BF3D.
If there is human intervention anywhere I usually throw out the
characters that are easily confused when viewed in some fonts or
handwritten. For example, l10OQZ26GVU and such.
One of the benefits of this approach is that a simple 4 character AN ID
can uniquely identify the following numbers of records:
9,999 numbers, i.e., 0937
456,976 AN UpperCase with 10 error prone characters removed, i.e., HAA3
1,679,616 AN including all UpperCase characters, i.e., 10OV
14,776,336 records using all AN characters both upper and lower case,
i.e., 3eHo
I choose the number of characters I need based on a clients project
needs. A year or region field can be easily combined to create a
primary key and you could start over each year if you like.
I have a routine I've been using for years with a table with acceptable
characters for a project so I can define whether to use all AN
characters including upper and lower case or just some and in any order
I choose.
I have another table with a single ID record that might begin with AAAA
or 0000 and code that increments the ID by looking at the last entry
and changing it based on my lookup table. This is not real fast when
generating a large number of these IDs but normally I just need one at
a time for a new unique record on an add new record form.
I have the added benefit of using this ID elsewhere such as in all or a
portion of file naming and then easily tying everything together or
finding some of a large number of files at any time.
I previously developed in a relational database language that had this
feature built in but I find no easier way for Access to accomplish
this. I shy away from the Autonumber as much as possible as a personal
preference.
Has anyone ever seen, developed or used a better method to create
defined AN IDs that I could use than my two table process?
length especially if they will ever be viewed as concatenated with
another field. For example, BF3D.
If there is human intervention anywhere I usually throw out the
characters that are easily confused when viewed in some fonts or
handwritten. For example, l10OQZ26GVU and such.
One of the benefits of this approach is that a simple 4 character AN ID
can uniquely identify the following numbers of records:
9,999 numbers, i.e., 0937
456,976 AN UpperCase with 10 error prone characters removed, i.e., HAA3
1,679,616 AN including all UpperCase characters, i.e., 10OV
14,776,336 records using all AN characters both upper and lower case,
i.e., 3eHo
I choose the number of characters I need based on a clients project
needs. A year or region field can be easily combined to create a
primary key and you could start over each year if you like.
I have a routine I've been using for years with a table with acceptable
characters for a project so I can define whether to use all AN
characters including upper and lower case or just some and in any order
I choose.
I have another table with a single ID record that might begin with AAAA
or 0000 and code that increments the ID by looking at the last entry
and changing it based on my lookup table. This is not real fast when
generating a large number of these IDs but normally I just need one at
a time for a new unique record on an add new record form.
I have the added benefit of using this ID elsewhere such as in all or a
portion of file naming and then easily tying everything together or
finding some of a large number of files at any time.
I previously developed in a relational database language that had this
feature built in but I find no easier way for Access to accomplish
this. I shy away from the Autonumber as much as possible as a personal
preference.
Has anyone ever seen, developed or used a better method to create
defined AN IDs that I could use than my two table process?