queries running through code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

While using the docmd.openquery method in VBA, does Access pause execution
until the query is completed? The reason I am asking is that I run 2 queries
with this method, the second is based on a table created from the 1st query.
I keep getting the "Unexpected Error" where Access shuts down and am
wondering if this is caused by the first query not completing, then the 2nd
query trying to start. If execution is not paused, is there a way to do so?
 
Hi Luke,

put these statements after the first query

currentdb.tabledefs.refresh
DoEvents

also, instead of docmd.openquery, use

currentdb.execute


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Back
Top