J
Jeff Schneider
Access 2002 DB. I'm running 5 queries and putting their results on 5 separate
tabs in the same Excel workbook using a button with the following code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query1",
"\\server\share\directory\ExcelFile.xls", , "Sheet1"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query2",
"\\server\share\directory\ExcelFile.xls", , "Sheet2"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query3",
"\\server\share\directory\ExcelFile.xls", , "Sheet3"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query4",
"\\server\share\directory\ExcelFile.xls", , "Sheet4"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query5",
"\\server\share\directory\ExcelFile.xls", , "Sheet5"
When I run this, after the 4th report, I receive the error "To many field
defined." and the code stops.
The query results are consistantly 3 columns by 10 rows, so I'm not sure
what it means by too many fields.
If I run each of these separately, they all work fine. They even will work
with 4 in a row, but when I add that 5th line, it chokes. I've even tried
changing the query order.
Suggestions?
tabs in the same Excel workbook using a button with the following code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query1",
"\\server\share\directory\ExcelFile.xls", , "Sheet1"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query2",
"\\server\share\directory\ExcelFile.xls", , "Sheet2"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query3",
"\\server\share\directory\ExcelFile.xls", , "Sheet3"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query4",
"\\server\share\directory\ExcelFile.xls", , "Sheet4"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Query5",
"\\server\share\directory\ExcelFile.xls", , "Sheet5"
When I run this, after the 4th report, I receive the error "To many field
defined." and the code stops.
The query results are consistantly 3 columns by 10 rows, so I'm not sure
what it means by too many fields.
If I run each of these separately, they all work fine. They even will work
with 4 in a row, but when I add that 5th line, it chokes. I've even tried
changing the query order.
Suggestions?