need help with name formats

M

Mark Revel

I have merged data from an Excel spreadsheet into Access, but there is only
one field for "NAME" and it is in this format: LAST,FIRST. How can I get
Access to convert the data within that field to FIRST LAST?
 
K

Klatuu

If you are using Access 2K or greater, you can use the Split function to
separate the names using the , as the delimiter:

Let's assume you have the Excel version (Last, Fist) in a string called
strFullName

Dim varBothNames as Variant
Dim strFirstName as String
Dim strLastName as String

varBothNames = Split(strFullName, ",")
strFirstName = varBothNames(1)
strLastName = varBothNames(0)

Now strFirst Name will be just the first name or everything to the right of
the comma and strLastName will be just the last name or everything to the
left of the comma.
 
E

Ed Warren

Or if you have them in excel just use the text to data function in Excel to
split them into two fields.

Ed Warren.
 
Top