G
Guest
I am trying to export a table to a fixed width text document with this syntax:
***Start Code***
'Open system form
DoCmd.OpenForm "FormSystem", , , , , acHidden
'Make temporary table
DoCmd.RunSQL "SELECT QueryPIExportUnion.Nominal,
QueryPIExportUnion.YearPeriod, QueryPIExportUnion.Date,
QueryPIExportUnion.Value, QueryPIExportUnion.DorC,
QueryPIExportUnion.JnlType, QueryPIExportUnion.Poster,
QueryPIExportUnion.JnlRef, QueryPIExportUnion.InvNo,
QueryPIExportUnion.Space4, QueryPIExportUnion.Prod,
QueryPIExportUnion.Supplier INTO TableTemp FROM QueryPIExportUnion;"
'Export text. This where the error occurs
DoCmd.TransferText acExportFixed, "ExportToSun", "TableTemp",
Forms![FormSystem]![ExportFile] & Forms![FormSystem]![ExportSequenceNo] &
".ndf"
'Close system form
DoCmd.Close acForm, "FormSystem"
'Delete temporary table
DoCmd.DeleteObject acTable, "TableTemp"
***End Code***
Whenever I do this I get this error message where indicated:
Run-time error '3027':
Cannot update. Database or object is read only.
What am I doing wrong?
Thanks in advance.
***Start Code***
'Open system form
DoCmd.OpenForm "FormSystem", , , , , acHidden
'Make temporary table
DoCmd.RunSQL "SELECT QueryPIExportUnion.Nominal,
QueryPIExportUnion.YearPeriod, QueryPIExportUnion.Date,
QueryPIExportUnion.Value, QueryPIExportUnion.DorC,
QueryPIExportUnion.JnlType, QueryPIExportUnion.Poster,
QueryPIExportUnion.JnlRef, QueryPIExportUnion.InvNo,
QueryPIExportUnion.Space4, QueryPIExportUnion.Prod,
QueryPIExportUnion.Supplier INTO TableTemp FROM QueryPIExportUnion;"
'Export text. This where the error occurs
DoCmd.TransferText acExportFixed, "ExportToSun", "TableTemp",
Forms![FormSystem]![ExportFile] & Forms![FormSystem]![ExportSequenceNo] &
".ndf"
'Close system form
DoCmd.Close acForm, "FormSystem"
'Delete temporary table
DoCmd.DeleteObject acTable, "TableTemp"
***End Code***
Whenever I do this I get this error message where indicated:
Run-time error '3027':
Cannot update. Database or object is read only.
What am I doing wrong?
Thanks in advance.