ExportXML with Filter not working

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top