I'm trying to automate the export of a query to a text file using
code. If I export the query manually I get the exact result that I
want i.e. If I select the query then choose File/Export from the menu
bar, choose "Text" as the save format, and then select "fixed width"
as the export format, I end up with a fixed width text file with no
column headers.
I've tried to automate the process using:
DoCmd.OutputTo acOutputQuery, "qry_Test", acFormatTXT, "Test.txt",
True
This gives me the following unwanted issues. The column headers are
exported, the fixed width columns are separated by a vertical line,
and the rows are separated by dashes. Also the resulting text file
appears on the screen. I just want it to save and not appear. What do
I need to do to automate the process and end up with a text file that
is formatted the same as when I use the manual method? i.e no headers,
no separaters and a silent save to the text file.
code. If I export the query manually I get the exact result that I
want i.e. If I select the query then choose File/Export from the menu
bar, choose "Text" as the save format, and then select "fixed width"
as the export format, I end up with a fixed width text file with no
column headers.
I've tried to automate the process using:
DoCmd.OutputTo acOutputQuery, "qry_Test", acFormatTXT, "Test.txt",
True
This gives me the following unwanted issues. The column headers are
exported, the fixed width columns are separated by a vertical line,
and the rows are separated by dashes. Also the resulting text file
appears on the screen. I just want it to save and not appear. What do
I need to do to automate the process and end up with a text file that
is formatted the same as when I use the manual method? i.e no headers,
no separaters and a silent save to the text file.
Comment