Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update query does not work in Macro -- but runs correctly when run by itself

Status
Not open for further replies.

Pack10

Programmer
Feb 3, 2010
495
US
I have a macro which contains a few update queries (8). My manager tells me a specific record was not updated
with the appropriate value, and when I reviewed the table, it was not updated.
Now, when I run the query from the Navigation pane, it updates the record correctly.
Do I need to do something in my macro or something....this is strange.
 
The only thing that comes to mind is that the record was locked when the macro was run and you set warnings to false / no in the macro and therefore did not see the error.
 
Others have had this, I see it in Google...but not clear on the fix. I am running them from a module now...and
have broken them up into 4 subs.....I will let you know.
 
This is so strange. When I run the update queries via code DoCmd.Openquery it's not updating all records...if i run it manually, it updates
all records. WHat is going on...is there a cache issue.
 
There are no parameters. The table contains
37,000 records,there are 16 queries
Most are update types. I do see a message
That there is not enough disk space
To undo the operation with a yes no
Cancel. If I suppress messages this
Won't be seen, does that have something
To so with my issue. I am going to try
Running two queries in 8 macros.
See if they run that way.
 
I'd try running the one query in a macro.... and then add things until it does not work starting with Set Warnings and then queries....
 
Latest update. I have broken up the queries, I am running about 4 to a Macro and it appears to be working as one would expect.
It must be a timing issue. This is rather different, its more like a data cleanup.
 
Timing... Unless you are doing something very specific that turns on some Asynchronous execution, I would expect Access to run Synchronously.

That being said, I have seen evil things happen based on OS write cache issues / client side file cahcing (Novel Netware).

In any case, good luck getting it to pause... I think they deprecated the sleep function (waits parameter passed in milliseconds)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top