I would like the final data to be filtered only to show the selected month.
What exactly do you mean? Filtered when opening a form with this data, or a report? or ...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi all,
I have this code in an Access database that create a table, runs two queries and append them into the table.
I would like the final data to be filtered only to show the selected month.
but for some reason the DoCmd.ApplyFilter doesn't work.
this is the error I get:
"Run-time error '2046':
The command or action 'ApplyFilter' isn't available now.
Sub CreateReport()
'Create a new table (and delete the old table)
DoCmd.RunSQL "SELECT * INTO REPORT_TABLE FROM QRY_Report_A;"
'Adds in the the next table by appending
DoCmd.RunSQL "INSERT INTO REPORT_TABLE SELECT * FROM QRY_Report_B;"
'Apply filter for the selected Month
DoCmd.ApplyFilter , "MONTH = '2022_02'"
MsgBox "Code has completed, starting at " & t & " and ending at " & Time()
End Sub
I would like the final data to be filtered only to show the selected month.
What exactly do you mean? Filtered when opening a form with this data, or a report? or ...