Split Full Name into Last and First Name (1 Viewer)

Local time
Today, 16:13
Joined
Jul 12, 2006
Messages
70
Is there a way to split the field record into 2? My field name is structured like this: De Jesus, Sheila
I would want to separate the last and given name.
I hate to do it manually because my record currently is now close to 5,000.
 

allan57

Allan
Local time
Today, 09:13
Joined
Nov 29, 2004
Messages
336
the code below shows how to split the users name, you need to use this a long side a recordset of the table you wish to update.


Dim strFullName As String
Dim strForeName As String
Dim strSurname As String

strFullName = "De Jesus, Sheila"

strSurname = Left(strFullName, InStr(1, strFullName, ",") - 1)
strForeName = LTrim(MID(strFullName, InStr(1, strFullName, ",") + 1))

Debug.Print strForeName
Debug.Print strSurname
 

Users who are viewing this thread

Top Bottom