Dim i, n As Integer
Dim chars(), FirstNames As String
What data type is i? chars()?
If you said Integer and string, incorrect. They are variants. Not sure if y'all realize that. If not, I'll say it's a common error when dimensioning multiple varibles on one line - which I often do, but this way:
Dim i as Integer, n as Integer
Dim chars() as String, FirstNames As String
Each has to be explicitly defined. Also, it is a good idea to declare the data type for an argument that is being passed:
Function Initials(name as String) <--unless coerced to some other type in the callling procedure,
name is a variant also.
Name is a word that should not be used for a variable. See
Microsoft Access tips: Problem names and reserved words in Access
Luckily, a variant will accept an empty string or null, but the code is only checking for ""
If IsEmpty(Names) Then
What if a Null is passed? Null and empty string are not the same.
No doubt it all works as expected, but when it doesn't, those are a few reasons why it can give trouble.