Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / August 2004

Tip: Looking for answers? Try searching our database.

Generating unique ID from names

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- 30 Aug 2004 14:12 GMT
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!
Nikos Yannacopoulos - 30 Aug 2004 14:34 GMT
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!
- 31 Aug 2004 03:53 GMT
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:
[quoted text clipped - 12 lines]
>
>.
Nikos Yannacopoulos - 31 Aug 2004 08:37 GMT
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
[quoted text clipped - 21 lines]
> >
> >.
John Vinson - 30 Aug 2004 17:50 GMT
>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)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.