The problem is the third parameter.
For official documentation of the method, the third parameter is the maximum amount of substrings you want. If not reported, or if the default value (-1) is given, there is no limit to substrings to return. But in your case...
If you say you want a substring at most, no matter how many times the delimiter appears in the input. You will get only one string.
If you want to separate in name and surname, pass at least 2
in the third parameter. This transforms:
"Derpino Augusto de Oliveira Lima"
In:
"Derpino", "Augusto de Oliveira Lima"
You can omit the third parameter to break the string in all spaces. And the default value for the second parameter, which is the delimiter, is space (" "
), then you can omit it too. It stays like this:
Tmp14 = Split(CorpID)
Good luck!
What is the content of
rsSQL.Fields("Name")
?– Caffé
A full name separated by spaces
– SaPires
The
split
is wrong for your purpose because you limited in1
the number of strings obtained. Even correcting thesplit
, you still have another problem: you are re-joining the name using the methodjoin
. See my answer.– Caffé