M
MS
I'm using Access 2003 with SP2 and I am having a problem exporting a
report to XML that has a filter. I am able to export the report to
other formats using the OutputTo method. Also, I can get the report to
export to XML if I don't use a filter.
I know that one of the parameters in the ExportXML function takes a
WHERE clause, but this did not work for me. I tried to save the Report
with the Filter and FilterOn properties set, and then use the ExportXML
function to export the report, but this did not work either. If I open
the report and then choose to export the report that way, I can get it
to work correctly by going into the Advanced options and then checking
the Use Filter option. But, I'm trying to do this through VBA code.
Does anyone know how to get this to work?
So far, I've tried this:
Application.ExportXML acExportReport, reportName, exportLocation,
, , , , , reportFilter
and this:
DoCmd.OpenReport reportName, acViewDesign
Reports(objectName).FilterOn = True
Reports(objectName).Filter = reportFilter
DoCmd.Save , tempReportName
DoCmd.Close acReport, objectName, acSaveNo
Application.ExportXML acExportReport, tempReportName, exportLoc
DoCmd.Close acReport, tempReportName, acSaveNo
Any help would be appreciated. Thanks.
report to XML that has a filter. I am able to export the report to
other formats using the OutputTo method. Also, I can get the report to
export to XML if I don't use a filter.
I know that one of the parameters in the ExportXML function takes a
WHERE clause, but this did not work for me. I tried to save the Report
with the Filter and FilterOn properties set, and then use the ExportXML
function to export the report, but this did not work either. If I open
the report and then choose to export the report that way, I can get it
to work correctly by going into the Advanced options and then checking
the Use Filter option. But, I'm trying to do this through VBA code.
Does anyone know how to get this to work?
So far, I've tried this:
Application.ExportXML acExportReport, reportName, exportLocation,
, , , , , reportFilter
and this:
DoCmd.OpenReport reportName, acViewDesign
Reports(objectName).FilterOn = True
Reports(objectName).Filter = reportFilter
DoCmd.Save , tempReportName
DoCmd.Close acReport, objectName, acSaveNo
Application.ExportXML acExportReport, tempReportName, exportLoc
DoCmd.Close acReport, tempReportName, acSaveNo
Any help would be appreciated. Thanks.