I am attempting to create a CSV file from a stored query. I have already created a record set from the query to update a table and create an Excel file.
I have tried the TransferText method. I can probably start from scratch with another routine to create the CSV file, but I thought I might be able to use the variable rs since it contains the results of the query. Is there a way?
Thanks
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim qdf As DAO.QueryDef
Set db = CurrentDb()
Set qdf = db.QueryDefs("qryTotals")
qdf.Parameters("[Forms]![Scan].[txtScanDate]") = txtScanDate.Value
qdf.Parameters("[Forms]![Scan].[txtScanNo]") = txtScanNo.Value
Set rs = qdf.OpenRecordset
rs.MoveFirst
I have tried the TransferText method. I can probably start from scratch with another routine to create the CSV file, but I thought I might be able to use the variable rs since it contains the results of the query. Is there a way?
Thanks