I have a number of reports in A2K and A97. They are opened from a form and are filtered using values selected on this form.
I already have a button to export the report to snapshot format using the following code:
DoCmd.OutputTo acOutputReport, , "SnapshotFormat(*.snp)", stFile, False, ""
I also have a button to export the report to Excel using code:
DoCmd.OutputTo acOutputReport, , acFormatXLS, stFile, False, ""
All works well, but what I really want to do is export the underlying recordset of the report (i.e. the original query along with the filters set through my form) as an excel sheet.
The difference between this and exporting the report to Excel is that I do not want the output grouped - I want a distinct line for every record so that users may take the file and sort and filterit themselves.
I want this to be a generic piece of code like the above, so that I do not have to have different button bars for every different report.
Does anyone know how to do this?
I already have a button to export the report to snapshot format using the following code:
DoCmd.OutputTo acOutputReport, , "SnapshotFormat(*.snp)", stFile, False, ""
I also have a button to export the report to Excel using code:
DoCmd.OutputTo acOutputReport, , acFormatXLS, stFile, False, ""
All works well, but what I really want to do is export the underlying recordset of the report (i.e. the original query along with the filters set through my form) as an excel sheet.
The difference between this and exporting the report to Excel is that I do not want the output grouped - I want a distinct line for every record so that users may take the file and sort and filterit themselves.
I want this to be a generic piece of code like the above, so that I do not have to have different button bars for every different report.
Does anyone know how to do this?