Michelangelo
Registered User.
- Local time
- Today, 11:53
- Joined
- Dec 20, 2002
- Messages
- 37
Hi,
I want to export a recordset which I created at runtime to a Excel table.
I tried to use docmd.outputto .. statement but I can't get it to work.
It returns a error telling me that datatypes do not match in the Docmd statement. I think it is because the rst is a Recordset Object and there should be a string value pointing to a Table in the DB.
The same goes for a querydef object and trying to use de outputto method with acOutputQuery instead of acOutputTable.
Any help is greatly appreciated.
I want to export a recordset which I created at runtime to a Excel table.
I tried to use docmd.outputto .. statement but I can't get it to work.
Code:
Dim rst as Recordset
Set rst = CurrentDB.OpenRecordset("SELECT * FROM strTable WHERE [Name] Like '*', dbOpenSnapshot)
DoCmd.OutputTo acOutputTable, rst, acFormatXLS, "D:\test.xls"
It returns a error telling me that datatypes do not match in the Docmd statement. I think it is because the rst is a Recordset Object and there should be a string value pointing to a Table in the DB.
The same goes for a querydef object and trying to use de outputto method with acOutputQuery instead of acOutputTable.
Any help is greatly appreciated.