My database must produces a .csv file with a header line that is different from the detail lines. This .csv file contains a monthly report to an outside agency and is uploaded online so it must follow specific guidelines.
As usual, I think I have made the processing way more convoluted than necessary. Here is what I have currently:
1) Macro #1 runs query #1 to create (or overwrite) a table with the current month's header information. This comes from a table.
2) Macro #2 runs query #2 to create (or overwrite) a table that contains the detail lines. This comes from a table as well.
3) Each of these newly created tables is then used to create a subreport which contains text boxes with the data in the order required for the .csv file. There are no labels included in these subreports.
4) The 2 subreports are then brought together into a single report with one header line in the report header section, and all the detail lines in the report detail section.
5) This final report is then programmatically output to an Excel file.
The probem is, the Excel file has extra rows that I don't want. Row 1 has the names for each field in the header line, row 3 is a blank line, and row 4 has names for each field in the detail lines.
The user then has to manually delete these lines and save the file in .csv format. If they delete the wrong line(s) the file will not upload correctly.
Is there a way to programmatically delete these lines before the database gives control back to the user? Or, have I overthought this whole process and if so, can you help me find an easier way to get to the desired result?