|
-
Oct 5th, 2012, 09:42 AM
#1
Thread Starter
Hyperactive Member
Connection to Access Won't Wait
I know many people have asked this question and I find different suggestions but am having no luck in finding a good solution. I have a connection query to an Access database that loads a query table on a spreadsheet. I've tried varous ways (Wait, Sleep, Do Untils, etc.) to delay subsequent VBA code from running until the query refresh completes, but can't find a way that works. Is there a way to tell when the query table has been fully refreshed so that code execution can continue?
The connection query executes automatically when its parameter changes. This parameter is changed by some code and then my code immediately does following:
With Sheets("Query Range")
Set Rcd = .Range("myRange").Find(myRcd)
(where myRcd is some value that is expected via the refresh and myRange is a column on the 'Query Range" sheet that contains the query table and should contain myRcd)
Rcd always returns 'Nothing'. Like I said, I've tried waiting, do loops with embedded 'sleep's, but can't find a way to delay the 'Set' execution until the query has been refreshed.
Thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|