strSQL = "SELECT DISTINCTROW [FirstName] & ' ' & [Middle] & ' ' & [LastName] & ' (, ' &
[Suffix] & ')' AS Name, "
Note the space between the single quotes. Are you wanting the parenthesis around the
[Suffix]? You also have the comma after the (.
Also, I don't recommend using Name as the field name. Name is a reserved word. Perhaps try
As WholeName
--
Wayne Morgan
Microsoft Access MVP
Scott said:
In VBE, I'm writing a SQL string that combines firstm middle, last and
suffix names. I can't get the quotes right.
I can do this easily is ASP code, but having trouble in access. Any ideas?
strSQL = "SELECT DISTINCTROW [FirstName]+" " & [Middle]+" " & [LastName]
& (", "+[Suffix]) AS Name, "