need updated table after querydefs

R

R. Choate

Using code, I run 2 append queries set up as querydefs in one sub. In my
next sub, I run a SQL which pulls all of the data from the table that just
got loaded by the 2 append queries. However, when I run the subs back to
back, I don't get all the records. The records from the 2nd append query
don't get included. If I run each sub from the VB editor, with a few seconds
between the 1st sub and 2nd sub, it gives me all the records. What can I do
to fix this?
 
V

Van T. Dinh

If you use DAO, add the statement:

DBEngine.Idle dbRefreshCache

after the coe to run the 2 Append Queries to make sure
Records are actually appended into the Table(s) rather
than still pending in cache.

HTH
Van T. Dinh
MVP (Access)
 
R

R. Choate

Thank you, Van. I ended up stumbling onto that one just before you
responded, and it did work great. Thanks a bunch!
Richard
--
RMC,CPA


If you use DAO, add the statement:

DBEngine.Idle dbRefreshCache

after the coe to run the 2 Append Queries to make sure
Records are actually appended into the Table(s) rather
than still pending in cache.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top