I created a form (based on a query) whereby users select from a dropdown, answer to date prompt (begin/end dates) and click “run query’ button to pass those parameters to the report. If users do not answer to a prompt, and/or do not make any selections, the report displays everything. If users made some selections, then the report reflects selections made and only shows filtered data. So far, this works beautifully.
I then created another command button to exports the filtered data to excel. Following is the code I used:
Private Sub cmdExport_Click()
DoCmd.OutputTo acOutputQuery, "qry_MyQueryName", acFormatXLSX, , True
But, the report gives me everything (it doesn’t reflect the filtered data)
Can you please assist?