Sash said:
I have text from another database where the field looks as follows:
Smith,John(Donna),Mr. & Mrs.
I need to separate this out into 4 columns.
Smith|John|Donna|Mr. & Mrs.
Is there an easy method to do thie?
Easy is a highly subjective term ;-)
This is a way to separate the four parts using a VBA
procedure:
Sub ParseName(strFull As String)
Dim start As Integer
Dim pos as Integer
pos = InStr(strFull, ",")
txtLastName = Left(strFull, pos - 1)
start = pos + 1
pos = InStr(start, strFull, "(")
txtFirstName = Mid(strFull, start, pos - 1)
start = pos + 1
pos = InStr(start, strFull, ")")
txtSpouseName = Mid(strFull, start, pos - 1)
txtTitle = Mid(strFull, pos + 1)
End Sub
That will work fine if txtLastName, etc, are text boxes in a
report (or form), but it will need a different approach if
you want to do this stuff in a query.