I am trying to export q query result set from MS access to CSV using VBA. When I run the query, I get 397 rows. When I run the export, I get nothing. The export is creating the file, but there are no rows in the file. The CSV export methods that I have tried are:
DoCmd.TransferText acExportDelim, , "MyQuery", "E:\path\path\filename.csv", True
DoCmd.OutputTo "MyQuery", "E:\path\path\filename", acFormatTXT, True
Funny thing is, when I export to XLS file format, I get the full query results. All 397 rows.
The XLS export method I am using is:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "MyQuery", "E:\path\path\filename.xls", True
It is too bad that the 3rd party system that I need to export the data for is not capable of using XLS. Must be CSV.