Extracting from Variable Extra Help

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

Thanks Doug,

It looks good but I just cant get it to work it says:-

Syntax error and I can't see the error

Sorry to ask for help once again

regards Ian



-----Original Message-----
If you're using Access 2000 or newer, you can use the Split function to
convert your string into an array of individual names, and then extract the
first letter from each name. Something like the following untested aircode:

Dim intLoop As Integer
Dim strInitials As String
Dim varNames As Variant

varNames = Split(FullName, " ")
If IsNull(varNames) = False Then
For intLoop = LBound(varNames) To UBound(varNames)
strInitials = strInitials & UCase(Left(varNames (intLoop), 1) & " "
Next intLoop
End If


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)





.
..
 
You need an extra closing parenthesis after the "1" as
shown

strInitials = strInitials &
UCase(Left(varNames(intLoop), 1)) & " "
 
Back
Top