Access 2016. I have a macro that runs a bit of code, which creates a query, (which is not run or otherwise involved going forward,) then runs almost a dozen Make Table queries to support the Final Query, and exports the Final Query to Excel, then exits Access.
About 80% of the time that DB opens and that macro runs, (scheduled once a day via task scheduler,) the Final Query export fails with "Query needs a destination field.."
When I go to open that query in design mode, it is empty. No tables or fields, nothing. If I look in SQL, it is empty. There is no SQL, except SELECT:
I have a backup copy of that query, I copy the SQL to the original, and run it, manually, it runs fine. When run next from the task scheduler, repeat from "About 80% of the time."
Any ideas on this one?
Phil