Extracting from Variable Extra Help

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!)





.
..
 
C

chrisj

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top