I'm attaching my code that exports the results of a query to excel.
I get an error of "To many fields defined" when I run this code.
I first thought it was a query problem and repaired and compacted Database but
that didn't help. On further investigation it was failing during the export to
excel. Let me know if you need more information. Help!
Thanks!
Dan
On Error GoTo cmdExportReport_Click_Err
DoCmd.TransferSpreadsheet acExport, 8, "RepairOpsBestPractices",
"R:\fcsd\SLTS Extract Database\OutputFiles\RepairOpsBestPracticesReport.xls",
True, ""
DoCmd.Close acForm, "frmElmStpsBestPractices"
Beep
MsgBox "The Repair Operation Best Practices Report has been exported into
Excel. Please go to your specified path to view to report. Thank you!",
vbOKOnly, ""
cmdExportReport_Click_Exit:
Exit Sub
cmdExportReport_Click_Err:
MsgBox Error$
Resume cmdExportReport_Click_Exit
I get an error of "To many fields defined" when I run this code.
I first thought it was a query problem and repaired and compacted Database but
that didn't help. On further investigation it was failing during the export to
excel. Let me know if you need more information. Help!
Thanks!
Dan
On Error GoTo cmdExportReport_Click_Err
DoCmd.TransferSpreadsheet acExport, 8, "RepairOpsBestPractices",
"R:\fcsd\SLTS Extract Database\OutputFiles\RepairOpsBestPracticesReport.xls",
True, ""
DoCmd.Close acForm, "frmElmStpsBestPractices"
Beep
MsgBox "The Repair Operation Best Practices Report has been exported into
Excel. Please go to your specified path to view to report. Thank you!",
vbOKOnly, ""
cmdExportReport_Click_Exit:
Exit Sub
cmdExportReport_Click_Err:
MsgBox Error$
Resume cmdExportReport_Click_Exit