A family of Microsoft relational database management systems designed for ease of use.
Perhaps the following functions will help:
Public Function FirstName(varFullName)
If Not IsNull(varFullName) Then
On Error Resume Next
FirstName = Left$(varFullName, InStr(varFullName, " ") - 1)
End If
End Function
Public Function MiddleName(varFullName)
Dim intFirstSpace As Integer, intSecondSpace As Integer
If Not IsNull(varFullName) Then
intFirstSpace = InStr(1, varFullName, " ")
If intFirstSpace > 0 Then
intSecondSpace = InStr(intFirstSpace + 1, varFullName, " ")
If intSecondSpace > 0 Then
MiddleName = Mid$(varFullName, intFirstSpace + 1, intSecondSpace - intFirstSpace)
End If
End If
End If
End Function
Public Function Lastname(varFullName)
Dim intLength As Integer, intCount As Integer
If Not IsNull(varFullName) Then
intLength = Len(varFullName)
For intCount = intLength To 1 Step -1
If Mid(varFullName, intCount, 1) = " " Then
Lastname = Mid(varFullName, intCount + 1)
Exit For
End If
Next intCount
End If
End Function
Beware of names like Victoria de los Angeles, however.
Ken Sheridan, Stafford, England