I suspect that's because the seconnd Query is running before the first Query has completed running.
Access is asynchronous, which is to say, if given a series of commands, it starts to execute one, moves on to the next one and starts executing it, and so forth. It doesn't wait for the first command to be completed before starting the second one, and this can cause timing problems.
If you’re running a series of Queries where all but the first Query is dependent upon the previous Query being completed before it starts to execute. The following VBA code
will immediately run all three, not waiting for one to finish executing before starting the next one. The answer to halting the code in this type of situation is to use DoEvents.
DoEvents returns control to Windows, allowing QueryA to complete running before starting to run QueryB. It then allows QueryB to finish running before starting QueryC.
DoEvents is an easy, safe bet when encountering what seems to be timing issues.
Hope this helps!
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007