|
-
Jul 7th, 2004, 04:12 PM
#1
Thread Starter
Hyperactive Member
Another name function...help!
This is the data I can have:
Gomez Maria F
Gomez Maria
Gomez
When I just have the last name and nothing else, it gives me an error. How can I fix this?
Here is the function:
Function FirstName(ByVal WholeName As String) As String
Dim arr() As String
Dim FName As String
WholeName = Replace(WholeName, ",", " ")
arr = Split(WholeName, " ")
If arr(1) = "III" Or arr(1) = "JR" Or arr(1) = "SR" Or arr(1) = "II" Then
Try
FName = arr(2)
Catch ex As Exception
FName = ""
End Try
Else
Try
FName = arr(1)
Catch ex As Exception
FName = ""
End Try
End If
Return FName
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|