Results 1 to 2 of 2
  1. #1
    MikeDS is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    1

    Wait for query to finish


    I have a function I've made to refresh a local table from a sharepoint list if the data was updated more than 4 hours prior to the function running. It works as expected. However, the query this function runs can take a long time (5+ minutes outside of the network) to complete. I'd like to have a means of, once the function triggers the query, to wait for it to complete and then let the user know it is done (via a MsgBox()).

    Is there anyway to wait for a DoCMD.OpenQuery() to complete? Any other ideas?

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    My understanding of VBA is that the code is processed iteratively. Basically, Line 1 has to be run AND BE COMPLETED before running line 2.

    Because of this, all you should have to do is add your MsgBox call immediately after the DoCmd.OpenQuery call.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pause / Wait / Countdown / Timer
    By DevGreg in forum Programming
    Replies: 2
    Last Post: 07-19-2022, 06:30 AM
  2. Open Form with instance method & wait to close?
    By GeorgeBakoyannis in forum Forms
    Replies: 1
    Last Post: 10-09-2010, 11:00 AM
  3. Need some support to finish DB
    By Estyl in forum Access
    Replies: 0
    Last Post: 04-22-2008, 04:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums