L
Lisa
I am trying to export data to Excel based on a certain
month a user chooses. In a form called frm_month, I would
like the user to choose the month they want the export
filtered. When the user clicks a command button, I have
used the following code to send it to Excel.
DoCmd.OutputTo acQuery, "qry_month", "MicrosoftExcel
(*.xls)", "D:\Month.xls"
Currently, it will send all records. How do I get the
query to take dynamic criteria (the particular month the
user chose on the form), so the export will only send that
month's data?
In the query itself, I tried setting the month criteria to
[Forms]![frm_month]![Combo26], but that didn't seem to
work. I received the following error:
The action or method is invalid because the form or report
isn't bound to a table or query.
month a user chooses. In a form called frm_month, I would
like the user to choose the month they want the export
filtered. When the user clicks a command button, I have
used the following code to send it to Excel.
DoCmd.OutputTo acQuery, "qry_month", "MicrosoftExcel
(*.xls)", "D:\Month.xls"
Currently, it will send all records. How do I get the
query to take dynamic criteria (the particular month the
user chose on the form), so the export will only send that
month's data?
In the query itself, I tried setting the month criteria to
[Forms]![frm_month]![Combo26], but that didn't seem to
work. I received the following error:
The action or method is invalid because the form or report
isn't bound to a table or query.