how do I generate an alphanumeric id in access

M

manatplay

I want to be able to create alphanumeric identities for clients. Is this
possible in Access?
 
T

Thomas Winkler

Hi,
I want to be able to create alphanumeric identities for clients. Is this
possible in Access?

Set the DefaultValue property to your personal ID-creator-function.
This function must be defined in a module like this

public function MyIDCreator(<params>) as string
'create your ID here

MyIDCreator = <created string>
end function

The use
DefaultValue=MyIDCreator()
in your ID field of the table.

Thomas
 
B

BruceM

Do you mean you want the identities created automatically? What format are
they to take?
 
R

Roger Carlson

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "Increment Alpha Field.mdb" which should give you a start.
It was created by Earl Brightup and you can find it here:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='Increment Alpha Field.mdb'

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
M

manatplay

I want to generate a unique alphanumeric number like the autonumber in
access, but in the form AAA1234 or something similar.
 
M

manatplay

Hi

Thanks for the reply. I don't think I'm an advanced enough user for your
answer - I didn't understand it!

Thanks anyway.
 
M

manatplay

Hi

I went to your site. Thanks. The generator works well there, but I want
something like the autonumber generator that access has to produce an
alphanumeric like your prog.
 
B

BruceM

You will need to describe exactly how you want the progression to go. What
comes after AAA1234? Will it always be three letters and four numbers, even
if the number is 0? What is the first number to be? Whatever it is, you
won't be using Autonumber. You can simulate the effect of Autonumber, but
you cannot get an Autonumber to incorporate letters.
 
T

Thomas Winkler

Hi,
I went to your site. Thanks. The generator works well there, but I want
something like the autonumber generator that access has to produce an
alphanumeric like your prog.

you cannot expect to solve complex problems with simple solutions. If you
want such a complex thing like alphanumeric IDs you have to use your own
function that generates your IDs.

BTW: May be it will help you to use 2 fields as your primary key. One Field
that contains the 3 letters and one AutoValue-field that contains the
numbers.

HTH

Thomas
 
Top