Hello All,
I have question as to the approach I should take regarding a problem I have.
I have a template csv file which has comes with headers. I now need to export multiple datas from my different tables into the csv file. I thought I would open an instance of excel, open the query as recordset (in VBA) and go through each record and finally use appExcel.saveAs as a CSV file. The approach doesnt look like it will look. I have looked into the DoCmd.Transfer text method but I cant seem to create a export specification because my query requires two parameters (startDate and endDate). If anyone could shed a bit more light on exporting results from a query into existing csv file would be great.
Secondly it is a huge template, over 700 fields and I will only be exporting around 40 fields so there will be huge number of empty fields. If this was a excel file, I would write few queries and write result from one query into the file then skip required columns and then write results from another query but I don't know if its possible with Docmd.write txt.
I can understand VBA fairly well and would really appreciate if you point me to any learning material,code examples or any other insights you have.
I am using access 2013 (Office 365 Pro) to perform all of this.
I have question as to the approach I should take regarding a problem I have.
I have a template csv file which has comes with headers. I now need to export multiple datas from my different tables into the csv file. I thought I would open an instance of excel, open the query as recordset (in VBA) and go through each record and finally use appExcel.saveAs as a CSV file. The approach doesnt look like it will look. I have looked into the DoCmd.Transfer text method but I cant seem to create a export specification because my query requires two parameters (startDate and endDate). If anyone could shed a bit more light on exporting results from a query into existing csv file would be great.
Secondly it is a huge template, over 700 fields and I will only be exporting around 40 fields so there will be huge number of empty fields. If this was a excel file, I would write few queries and write result from one query into the file then skip required columns and then write results from another query but I don't know if its possible with Docmd.write txt.
I can understand VBA fairly well and would really appreciate if you point me to any learning material,code examples or any other insights you have.
I am using access 2013 (Office 365 Pro) to perform all of this.