Is there anything intrinsically wrong in using a TempVar in a field definition of an Access SQL query?
As a simplified test I have witten a simple query qry_LOI3 thus:
The datasheet it generates is shown in the attached screenshot.
I then try to open it as a recordset, thus:
This gives Error 3061 - "Too few parameters. Expected 1."
Same result if I open as dbOpenDynaset.
??
Screenshot.docx
As a simplified test I have witten a simple query qry_LOI3 thus:
Code:
SELECT EventTypes.EventCode, [TempVars]![Drv] AS Expr1 FROM EventTypes;
I then try to open it as a recordset, thus:
Code:
Public Sub TestProc()
Dim db As Database, rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("qry_LOI3", dbOpenForwardOnly)
End Sub
Same result if I open as dbOpenDynaset.
??
Screenshot.docx
Comment