This is the query I am trying to export into Excel automatically:
SELECT tblBook.bkISBN, tblBook.bkAuthor, tblBook.bkTitle,
tblBook.bkHardback, tblBook.bkPagecount,
tblBook.bkTrimmedPageSize, tblJob.jbQuantity
FROM dbo.tblBook INNER JOIN
dbo.tblJob ON
dbo.tblBook.bkISBN = dbo.tblJob.jbISBN
WHERE (dbo.tblJob.jbDespatchedWhen < CONVERT(DATETIME,
'2003-11-01 00:00:00', 102)) AND
(dbo.tblJob.jbDespatchedWhen > CONVERT(DATETIME,
'2003-09-30 00:00:00', 102)) AND
(dbo.tblBook.bkClient = N'bsp') AND
(dbo.tblJob.jbQuantity < 100)
This is the line of VBA I am trying to get to do it - on the event of clicking a button:
DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel3, "TESTAutoExcelDump", "C:\text"
This is the error I get:
Run time error 3146. ODBC call failed, There is already an object named "TESTAutoExcelDump" in the database. #2714.
Can anyone help?