Hi -- need some help ASAP!!! Also, sorry for the long post... if you're looking for the main code/issue please skip to the bottom of the post.
I've read an endless number of forums relating to this issue over the last week trying to figure out my problem, but have not had any luck applying the solution to my situation.
I am trying to use Allen Browne's ConcatRelated function (found here: http://allenbrowne.com/func-concat.html) to concatenate a list of values from my query into one row. I keep gettting the syntax error "Error 3061: Too few parameters. Expected 3".
I have tried all the different variations of [], '', "", but nothing has worked. I almost feel that the way I have set things up just will not work with this function - so I will give some context on my environment.
I built a form "Pass Percentage Form" to filter down the results of a previous query, "Pivoted Data". This form is used generate the criteria for a new query "Pivoted_Data_Query". The form uses 3 cascading combo boxes to essentially set the WHERE clause of the results of the "Pivoted_Data_Query". The code for this query is as follows:
Now, I am getting the right information, but rather than it display results like:
Control1, ASD1, Score
Control1, ASD2, Score
I want to display them like:
Control1, "ASD1, ASD2" , Score
Hence, where Allen Browne's function comes into play. So I tried to create a new query (which is working off of another query, which is working off of a form -- is this an issue?) to implement this code, and this is where I get the "Too few parameters" error. Is this the best way to do this, or is there a way I can implement the function in the first query?
Code:
Any help would be IMMENSELY appreciated - I am stuck and on a tight deadline. I know this is probably very confusing, so I apologize, but I just started working with Access two weeks ago. This is probably too high-level for me but I am determined to figure it out!!
I've read an endless number of forums relating to this issue over the last week trying to figure out my problem, but have not had any luck applying the solution to my situation.
I am trying to use Allen Browne's ConcatRelated function (found here: http://allenbrowne.com/func-concat.html) to concatenate a list of values from my query into one row. I keep gettting the syntax error "Error 3061: Too few parameters. Expected 3".
I have tried all the different variations of [], '', "", but nothing has worked. I almost feel that the way I have set things up just will not work with this function - so I will give some context on my environment.
I built a form "Pass Percentage Form" to filter down the results of a previous query, "Pivoted Data". This form is used generate the criteria for a new query "Pivoted_Data_Query". The form uses 3 cascading combo boxes to essentially set the WHERE clause of the results of the "Pivoted_Data_Query". The code for this query is as follows:
Code:
SELECT [Pivoted Data].[Process], [Pivoted Data].[Control ID] AS ControlID, Round(Avg([Pivoted Data].[Pass]),2)*100 AS [Pass %], [Pivoted Data].[ASD]
FROM [Pivoted Data]
WHERE ((([Pivoted Data].Place)=Forms![Pass Percentage Form]!Place_combo) And (([Pivoted Data].Test)=Forms![Pass Percentage Form]!Test_combo) And (([Pivoted Data].[Testing Date])=Forms![Pass Percentage Form]!Testing_combo))
GROUP BY [Pivoted Data].[Process], [Pivoted Data].[Control ID], [Pivoted Data].Place, [Pivoted Data].Test, [Pivoted Data].[Testing Date], [Pivoted Data].[ASD]
ORDER BY [Pivoted Data].[Control ID];
Now, I am getting the right information, but rather than it display results like:
Control1, ASD1, Score
Control1, ASD2, Score
I want to display them like:
Control1, "ASD1, ASD2" , Score
Hence, where Allen Browne's function comes into play. So I tried to create a new query (which is working off of another query, which is working off of a form -- is this an issue?) to implement this code, and this is where I get the "Too few parameters" error. Is this the best way to do this, or is there a way I can implement the function in the first query?
Code:
Code:
SELECT DISTINCT [Pivoted_Data_Query].[ControlID], [Pivoted_Data_Query].[Pass %], [Pivoted_Data_Query].[Process], ConcatRelated("KSD","Pivoted_Data_Query","[ControlID] ='" & [ControlID] & "'") AS ASDs
FROM [Pivoted_Data_Query];
Any help would be IMMENSELY appreciated - I am stuck and on a tight deadline. I know this is probably very confusing, so I apologize, but I just started working with Access two weeks ago. This is probably too high-level for me but I am determined to figure it out!!
Last edited: