how do I generate an alphanumeric id in access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to be able to create alphanumeric identities for clients. Is this
possible in Access?
 
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
 
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
 
I want to generate a unique alphanumeric number like the autonumber in
access, but in the form AAA1234 or something similar.
 
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.
 
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 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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top