I get this VBA error when I try to execute a query with 3 parameters
"-2147217887: Multiple-step OLE DB operation generated errors"
It runs fine from Access and I have run many queries in VBA without an issue. I don't believe I have previously seen this error so hopefully someone can help.
The parameters are:
.Parameters.Append .CreateParameter("param1", adVarWChar, adParamInput, adChar, i)
.Parameters.Append .CreateParameter("param2", adDate, adParamInput, adChar, Me.StartDate)
.Parameters.Append .CreateParameter("param3", adDate, adParamInput, adChar, Me.EndDate)
For the parameters, i starts as 1 and the form contains the StartDate and EndDate date fields.
The query does a Group By:
SELECT Main.Category
FROM Main
WHERE (((Main.Type)=[Type: 1=Safety; 2 = Maintenance]) AND
((Main.[End Date]) Between [Close Date - Start] And [Close Date - End]))
GROUP BY Main.Category;
"-2147217887: Multiple-step OLE DB operation generated errors"
It runs fine from Access and I have run many queries in VBA without an issue. I don't believe I have previously seen this error so hopefully someone can help.
The parameters are:
.Parameters.Append .CreateParameter("param1", adVarWChar, adParamInput, adChar, i)
.Parameters.Append .CreateParameter("param2", adDate, adParamInput, adChar, Me.StartDate)
.Parameters.Append .CreateParameter("param3", adDate, adParamInput, adChar, Me.EndDate)
For the parameters, i starts as 1 and the form contains the StartDate and EndDate date fields.
The query does a Group By:
SELECT Main.Category
FROM Main
WHERE (((Main.Type)=[Type: 1=Safety; 2 = Maintenance]) AND
((Main.[End Date]) Between [Close Date - Start] And [Close Date - End]))
GROUP BY Main.Category;