[FName] & " " & ([MI] + ". ") & [LName]
to get "Jim Smith" instead of "Jim . Smith" if there is no MI.
John W. Vinson [MVP]
John, +" " & in my code does exatly what you suggest if FName is
null. Have you found the parentheses necessary, my example seems
works without them.
The parentheses *are* necessary. If FName can be null (I didn't
account for that!) you should in fact use
([FName] + " ") & ([MI] + ". ") & [LName]
The logic is that anything + NULL is NULL; so if FName is null,
the expression [FName] + Null
will be NULL. The & operator treats NULL as if it were an empty
string, so by putting the + expression in parentheses, a null
FName doesn't drag along an extra blank.
I'm not sure about the precedence of + and & - you might be able
to get by without the parentheses if the + operator is processed
first, but they don't hurt and make the order of operations
explicit.
John W. Vinson [MVP]