I would like to export data from an Access filter form to excel.
I want to use "RecordSource" instruction.
Here my code:
Set ExportQuery = CurrentDb.CreateQueryDef("ExportQuery", Me.RecordSource & " WHERE " & Me.Filter)
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "ExportQuery", "c:\Report\test.xlsx", False
Any idea why that doesn't work?