Generating unique ID from names

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

Guest

How does one generate unique id composed from first 3
letters of last name and first 2 from first name. I
assume this is common as I have seen it but don't know
how to program it. Thanks!
 
In theory, you could get that by:
Left([LastName],3) & Left([FirstName],2)

It doesn't sound like a very good idea, though; how do you know there will
ever be just one John Smith? And, no, this is not a common practice. The
common practice is to use an autonumber field for a PK in a people table.

HTH,
Nikos
 
How does one generate unique id composed from first 3
letters of last name and first 2 from first name. I
assume this is common as I have seen it but don't know
how to program it. Thanks!

You don't, typically.

Such "Intelligent Keys" maybe made sense in the 1950's, but they do
NOT now. If the unique ID for Fred Johnson is FRJOH, what is the
unique ID for Francis Marie Johnston? or what do you do with FRJOH if
Francis changes her name to Marie Robertson?

Just store names AS DATA; use a hidden Autonumber, or a sequentially
assigned meaningless numeric ID as your unique key.

John W. Vinson[MVP]
(no longer chatting for now)
 
Thanks for the timely response and I will probably use
auto number however, could you go into more detail as to
how your response, Left([LastName],3) & Left
([FirstName],2)is used and where it is put. Just
learning and all this information is appreciated.
-----Original Message-----
In theory, you could get that by:
Left([LastName],3) & Left([FirstName],2)

It doesn't sound like a very good idea, though; how do you know there will
ever be just one John Smith? And, no, this is not a common practice. The
common practice is to use an autonumber field for a PK in a people table.

HTH,
Nikos

How does one generate unique id composed from first 3
letters of last name and first 2 from first name. I
assume this is common as I have seen it but don't know
how to program it. Thanks!


.
 
It would be used wherever you want it calculated, e.g. in a calculated
control on a form or report (either in the default value or in the
controlsource property, depending on what you are trying to achieve), in a
calculated field in a query etc.

Nikos

Thanks for the timely response and I will probably use
auto number however, could you go into more detail as to
how your response, Left([LastName],3) & Left
([FirstName],2)is used and where it is put. Just
learning and all this information is appreciated.
-----Original Message-----
In theory, you could get that by:
Left([LastName],3) & Left([FirstName],2)

It doesn't sound like a very good idea, though; how do you know there will
ever be just one John Smith? And, no, this is not a common practice. The
common practice is to use an autonumber field for a PK in a people table.

HTH,
Nikos

How does one generate unique id composed from first 3
letters of last name and first 2 from first name. I
assume this is common as I have seen it but don't know
how to program it. Thanks!


.
 
Back
Top