I've written a short function to concatenate a full name from its parts. I did it mostly to practice writing functions, but thought it would come in handy. I stuck it in a new module. Here it is.
Code:
Public Function ApplicantName(FName As String, MI As String, LName As String)
ApplicantName = FName & IIf(MI = "", "", " " & MI & ".") & " " & LName
End Function
When I call this from a form to populate a text box, it works just fine. When I put it in the query I get a Data Type Mismatch in criteria expression. Here's the SQL.
Code:
SELECT SSN, Applicant.Appl_Fname, Appl_MI, Applicant.Appl_Lname, ApplicantName([appl_FName],[appl_MI],[appl_LName]) AS Full_Name
FROM Applicant
GROUP BY SSN, Appl_Fname, Appl_MI, Appl_Lname, ApplicantName([appl_FName],[appl_MI],[appl_LName]);
This is a RowSource for a combo box.
Appl_Name: ApplicantName([appl_fname],[appl_mi],[appl_LName])