Hello
I have a query qryContactDetails which is a parameter query with the following SQL:
I wanted to then produce another query which would concatenate the EmailDisplayName fields for all those records in the above query.
I tried to lay it out in the much used Family example and that is why I made the [SelectionID] field as above. However, I still can't get it to work with the following code:
It just comes back with : "Error 3061 - too few parameters. Expected 2"
Does anybody know what is wrong??
I have a query qryContactDetails which is a parameter query with the following SQL:
Code:
SELECT 1 AS SelectionID, tblPeople.ID, tblPeople.Title, tblPeople.FirstName, tblPeople.LastName, tblPeople.Department, tblPeople.JobTitle, tblPeople.BusinessStreet, tblPeople.BusinessCity, tblPeople.BusinessState, tblPeople.BusinessPostalCode, tblPeople.BusinessFax, tblPeople.BusinessPhone, tblPeople.BusinessPhone2, tblPeople.MobilePhone, tblPeople.OtherFax, tblPeople.Pager, tblPeople.EmailAddress, tblPeople.EmailType, tblPeople.EmailDisplayName, tblPeople.Initials, tblPeople.Picture, IIf(([Picture]) Is Not Null,"Picture Available","Picture Not Available") AS PictureAvailable
FROM tblPeople
WHERE (((tblPeople.Department)=[Forms]![frmContacts]![cmbDepartment]) AND ((InStr([JobTitle],[Forms]![frmContacts].[cmbInd]))<>0)) OR (((InStr([JobTitle],[Forms]![frmContacts].[cmbInd]))<>0) AND (([Forms]![frmContacts]![cmbDepartment])="*"))
GROUP BY 1, tblPeople.ID, tblPeople.Title, tblPeople.FirstName, tblPeople.LastName, tblPeople.Department, tblPeople.JobTitle, tblPeople.BusinessStreet, tblPeople.BusinessCity, tblPeople.BusinessState, tblPeople.BusinessPostalCode, tblPeople.BusinessFax, tblPeople.BusinessPhone, tblPeople.BusinessPhone2, tblPeople.MobilePhone, tblPeople.OtherFax, tblPeople.Pager, tblPeople.EmailAddress, tblPeople.EmailType, tblPeople.EmailDisplayName, tblPeople.Initials, tblPeople.Picture, IIf(([Picture]) Is Not Null,"Picture Available","Picture Not Available"), tblPeople.LastName
ORDER BY tblPeople.LastName, tblPeople.FirstName;
I tried to lay it out in the much used Family example and that is why I made the [SelectionID] field as above. However, I still can't get it to work with the following code:
Code:
SELECT qryContactDetails.SelectionID, Concatenate("SELECT EmailDisplayName FROM qryContactDetails WHERE SelectionID =" & [SelectionID]) AS Emails
FROM qryContactDetails;
Does anybody know what is wrong??