Parsing A Name Fields

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

Guest

I have a field with the first and last names together. What function can I
use parse the first and last name.
 
Check out Split() as in

Split([myString], [delimiter])

To use it the code would be along the lines of

Dim aMyArray as Array
aMyArray = Split("David Holley", " ")

That *should* do it. I'm writting this off the top of my head.
 
You can look at various string functions like:
Instr()
Mid()
Left()
and
Right()
You might need to open any module in order to find this help.
 
iholder said:
I have a field with the first and last names together.
What function can I use parse the first and last name.

Every entry having exactly one first and one last name would be an extremely
well-formed name list. Generally you have to account for First and Last like
"Billy Jo Smith", "Yvonne De Carlo", or "R C Slocum" along with "Fred Jones"
and "Ann Thomas". And, once in a while, you'll find a Last-Name-First entry,
such as "Jones, Fred".

You've already got good sugestions for the well-formed name list. Googling
the archives of this newsgroup and other Access newsgroups may provide some
hints on the exceptional cases.

Larry Linson
Microsoft Access MVP
 
Back
Top