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.
'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()