need help for change full name code

  • Thread starter Thread starter Habeeb
  • Start date Start date
H

Habeeb

I am working on the Contact management Database and i have a problem changing
the code for Full name field .
i wanna change it from first name + last name to first name + middle name +
last name .

the current code is the following :

SELECT IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First
Name])) AS [File As], IIf(IsNull([Last Name]),IIf(IsNull([First
Name]),[Company],[First Name]),IIf(IsNull([First Name]),[Last Name],[First
Name] & " " & [Last Name])) AS [Contact Name], Contacts.*
FROM Contacts
ORDER BY IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First
Name])), IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[First Name] & " " & [Last
Name]));

i am new to access and i wish you could help with this problem
Best regards
Mohamed Habeeb
 
Add a column to your query

FileAs: ([FirstName] + " ") & ([MiddleName] + " ") & [LastName]

This uses a trick within VBA that concatenates anything using an ampersand
(&) but ignores a plus (+) sign
 
Back
Top