I am trying to run a query stored in access database from excel vba. The query runs fine if I open and run it in access database but causing error while running it from VBA module. The query uses a stored function called "Getlist" which is in access database module. Below is the query.
SELECT paramconcat.parameter, GetList("Select concat From paramconcat As T1 Where T1.parameter = """ & [paramconcat].[parameter] & """","",", ") AS Concatenated INTO results
FROM paramconcat
GROUP BY paramconcat.parameter;
VBA Module
Sub test1()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Set con = New ADODB.Connection
With con
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Open "C:\Users\erukhq\Documents\My Received Files\paramcheck.accdb"
End With
con.Execute "ParamconcatQ"
con.Close
End Sub
The error I am getting is as below.
