need help for change full name code

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
 
A

Arvin Meyer MVP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top