I'm really struggling to generate an MS Access report using a crosstab query. Hopefully someone here can help.
Using the guide provided in the Access 2000 Developer's Handbook, I've created the report and I'm attaching some VBA to label the columns correctly. This requires the creation of a RecordSet to get the field names. Unfortunately the open command for the recordset is crashing with an error that reads
The SELECT statement includes a reserved work or an argument name that is misspelled or missing, or the punctuation is incorrect.
This just isn't he case, so I'm lost.
Here's the SQL:
Code:
And here's the VB Code:
Code:
I don't see anything exotic in the SQL or VBA. The SQL runs as a standard MS Access Query, it's just through VBA / ADO that it's choking.
Any ideas why?!?!?
Thanks in advance!
- Bryan
Using the guide provided in the Access 2000 Developer's Handbook, I've created the report and I'm attaching some VBA to label the columns correctly. This requires the creation of a RecordSet to get the field names. Unfortunately the open command for the recordset is crashing with an error that reads
The SELECT statement includes a reserved work or an argument name that is misspelled or missing, or the punctuation is incorrect.
This just isn't he case, so I'm lost.
Here's the SQL:
Code:
Code:
TRANSFORM COUNT(TrafficSource_ByWeek.traffic) AS TrafficSum
SELECT TrafficSource_ByWeek.StartOfWeek
FROM TrafficSource_ByWeek
GROUP BY TrafficSource_ByWeek.StartOfWeek
PIVOT TrafficSource_ByWeek.source;
And here's the VB Code:
Code:
Code:
Dim rst As adodb.Recordset
Set rst = New adodb.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.source = Me.RecordSource
rst.Open options:=adCmdTable
I don't see anything exotic in the SQL or VBA. The SQL runs as a standard MS Access Query, it's just through VBA / ADO that it's choking.
Any ideas why?!?!?
Thanks in advance!
- Bryan