Message 1 of 5
parsing full name

Not applicable
09-16-2002
07:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Trying to parse a persons full name to return with a
firstInitial Lastname. If Frank L. Couger,
it will return with a F Couger
Here is my code but does wotk right.
Can someone fix it?
Dim FullName As String
Dim first, last, name, fi As String
Dim pos, L As Integer
FullName = DSLENGR_Replace
If FullName = DSLENGR_Replace Then
pos = InStr(FullName, " ")
If pos = 0 Then
first = FullName
Else
first = Left(FullName, pos - 1)
End If
fi = Left(first, 1)
L = Len(FullName)
last = Right(FullName, L - 1)
ENG_NAME_Replace = fi & " " & last
Me.ENG_NAME_Replace = UCase(Me.ENG_NAME_Replace)
firstInitial Lastname. If Frank L. Couger,
it will return with a F Couger
Here is my code but does wotk right.
Can someone fix it?
Dim FullName As String
Dim first, last, name, fi As String
Dim pos, L As Integer
FullName = DSLENGR_Replace
If FullName = DSLENGR_Replace Then
pos = InStr(FullName, " ")
If pos = 0 Then
first = FullName
Else
first = Left(FullName, pos - 1)
End If
fi = Left(first, 1)
L = Len(FullName)
last = Right(FullName, L - 1)
ENG_NAME_Replace = fi & " " & last
Me.ENG_NAME_Replace = UCase(Me.ENG_NAME_Replace)