This problem has come around many times in these forums. Because of the inconsistency of the data, it's almost impossible to parse the initials out with 100% accuracy. You would write something that checked for the last Upper Case value and then take that and put it into a new field but that would bomb on two of your names. That's about as close as you could get. Let me know what you want to do and I can write the routine but then you would have to clean it up manually.
Looking for the last space will improve your accuracy but still not 100% (there are certainly last names with spaces in them) but his routine will get you started. You would add it to a module and then call it from the query.
Function GetLast(strSource As String) As String
Dim I As Integer
Dim OneChr As String
OneChr = " "
For I = Len(strSource) To 1 Step -1
If Mid(strSource, I, 1) = OneChr Then
GetLast = Right(strSource, Len(strSource) - I)
Exit Function
End If
Next I
GetLast = strSource
th1011, to merge fields together, in a new column in a query you would put
MyMergedFields:[Field1] & " " & [Field2] & " " & [Field3}
This would merge three fields with a space between them.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.