Export data from filtered subform to Excel ?




I have got a form with a subform. The subform's recordsource is a saved
query, which selects data from some tables. The user has the option to filter
the form which I implemented with:

'SQLstr is my filter string
Me.ufo_reports.Form.Filter = SQLstr
Me.ufo_reports.Form.FilterOn = True

This works fine. But now I want to export the filtered data to Excel. I use
the following code, but it exports me everytime the full data (not filtering):

'ufo_reports is the subform
DoCmd.OutputTo acOutputForm, "ufo_reports", acFormatXLS, "ufo_reports.xls",

Why is this not working and how can I export the filtered data to Excel? thx
for any help in advance.


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