alktrigger
Aimless Extraordinaire
- Local time
- Today, 06:18
- Joined
- Jun 9, 2009
- Messages
- 124
I'm attempting to export a table that is compiled via queries to be used as a report. The table has 17 fields, and only holds 50 records(+/-5). When I run export code it gives me the 3190 error : "Too many fields defined". The error occurs right after the section of code in red.
This was a direct transfer from another prototype of this DB and used to work flawlessly. Any suggestions?
Edit: sorry for the spam
Code:
strTable = "tblReport"
[COLOR=SeaGreen]'Create worksheet save name:[/COLOR]
strWorksheetPath = "C:\"
strWorksheet = "DS_Weekly"
strSaveName = strWorksheetPath & strWorksheet & ".xls"
Debug.Print "Worksheet; Save; Name; " & strSaveName; ""
On Error Resume Next
[COLOR=SeaGreen] 'Delete existing worksheet (if there is one):[/COLOR]
Kill strSaveName
On Error GoTo ErrorHandler
[COLOR=SeaGreen]'Export query data to a new worksheet in Excel 9 format:[/COLOR]
[COLOR=Red]DoCmd.TransferSpreadsheet transfertype:=acExport,_
spreadsheettype:=acSpreadsheetTypeExcel8,_
TableName:=strTable, FileName:=strSaveName, _
Hasfieldnames:=True[/COLOR]
Edit: sorry for the spam
Last edited: