Modify how a name is viewed

Whispersplus1

Registered User.
Local time
Today, 15:58
Joined
Feb 1, 2010
Messages
13
In my database I have input customers names in three columns Last, First and MI. I used the phrase below.....
IIf(IsNull([Last]),IIf(IsNull([First]),[First]),IIf(IsNull([First]),[Last],[Last] & ", " & [First]))
to get the whole name to appear in one column...example Smith, John T.
Heres where I need help......
One of our programs, download customers names on a excel spread sheet with the last name and first name in the same column, is it possible to get Access 2007 to separate the name accordingly?
 
Do you not have these fields save seperately in your db?

Have a look at the Split() function.
 
You can use InStr() and InStrRev to extract the first and last words in the string to get your forename and surname.

Forename = IIF(Instr(FullName," ")> 0,Left(InStr(FullName," ")-1),FullName)
Surname = IIF(InstrRev(FullName," ")> 0,Mid(InStr(FullName," ")+1),FullName)

However you may have issues with double barrelled names

David
 

Users who are viewing this thread

Back
Top Bottom