L
Len B
Relevant VBA snippets -
DIM dbsTadPJ as Database, rstPJ as Recordset, stSQLExport as String
stSQLExport = "SELECT SupplierInvoice ....
stSQLExport = stSQLExport & "FROM Purchases INNER JOIN ...
stSQLExport = stSQLExport & "GROUP BY ...
Set dbsTadPJ = CurrentDb()
Set rstPJ = dbsTadPJ.OpenRecordset(stSQLExport, dbOpenDynaset) ****
Line **** generates Type mismatch error. I have used this syntax
successfully elsewhere.
By using a breakpoint and the intermediate window, I got the SQL string
produced by the concatenation process into the clipboard. I then pasted
it into a new query which produced the 13 records I was expecting.
As far as I can see I am attempting to assign a recordset to a variable
of type recordset. Aren't I? Any hints what to try now.
DIM dbsTadPJ as Database, rstPJ as Recordset, stSQLExport as String
stSQLExport = "SELECT SupplierInvoice ....
stSQLExport = stSQLExport & "FROM Purchases INNER JOIN ...
stSQLExport = stSQLExport & "GROUP BY ...
Set dbsTadPJ = CurrentDb()
Set rstPJ = dbsTadPJ.OpenRecordset(stSQLExport, dbOpenDynaset) ****
Line **** generates Type mismatch error. I have used this syntax
successfully elsewhere.
By using a breakpoint and the intermediate window, I got the SQL string
produced by the concatenation process into the clipboard. I then pasted
it into a new query which produced the 13 records I was expecting.
As far as I can see I am attempting to assign a recordset to a variable
of type recordset. Aren't I? Any hints what to try now.