Output an access report to excel files with filtered a filtered date range.

F

Frank

I need a little help with following


I have an input form that has a start date and end date. Also the form has
an OK button and cancel button. the OK button events code filters date
ranges and ends with a preview of a report that has been filtered. On the
report are two text boxes that are linked to the Start date text box and end
date text box on the form.

Everything works great; however, what I want to do in addition to the report
preview, is output the previewed report to an Excel file that still
maintains the filtered results.

For example, if a date range is between 1/1/03 and 2/1/03, the previewed
report reflects all records that fall within this date range. I what to be
able to output the report with above date range to an excel file in addition
to the report preview. I used the following code and it works but only
returns all records, not filtered records. I am just not sure how to tie it
together with the report preview.

DoCmd.OutputTo acReport, "My Report", "MicrosoftExcelBiff8(*.xls)", "",
False, "", 0

Any assistance is greatly appreciated.
 
F

Frank

John:
Thanks for post. Will look into your suggestions; however, user really like
the input form.

Thanks again for your assistance.



Frank
 
J

John Crighton

Frank,

You can still use the form - just base the query's
criteria on controls of the form, for example, the
criteria for the field "Order ID" would be forms!
[frmMyForm]![Order ID]

HTH

John.
 

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