SOLVED

Pause code

Brass Contributor

I am running quite a few queries in VBA to create a master query that is the recordsource for a report before opening the report in preview mode. Is there a command that would create a short pause to allow all the queries to run completely before previewing the report? I am getting an error 7874 intermittently.

 

Thank you in advance,

Max

2 Replies
Do you mean to say you are Creating or Updating queries before running the report?
In that case you need to refresh the QueryDefs collection:
currentdb.QueryDefs.Refresh
best response confirmed by Maxine14062 (Brass Contributor)
Solution
Thank you so much.
1 best response

Accepted Solutions
best response confirmed by Maxine14062 (Brass Contributor)
Solution
Thank you so much.

View solution in original post