By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

Update not seen in subsequent query

P: n/a
Seeing an odd situation I've not seen before.

Have VB that updates a field in a table based on a form value when a
button is clicked. Directly after the .Update, I call another
function that does some other work and, in the process, queries the
table I just updated for the record I just updated and it does not see
the update I just made.

If I run in the debugger the problem doesn't occur. It seems like the
..Update event is not yet completed before the subsequent query is
executing (running in the debugger slows execution down sufficiently
for the update to complete?)

Is this a feasible explanation? Is there a solution?

The table involved is about 10,000 records.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Try sticking in a DoEvents between the execution of the update query
and the subsequent select query. Queries execute asynchronously (I
think), so you could be trying to read the updated table before the
update is complete.
Nov 12 '05 #2

P: n/a
DFS

"Jeff Wilson" <jw*********@attbi.com> wrote in message
news:fc*************************@posting.google.co m...
Seeing an odd situation I've not seen before.

Have VB that updates a field in a table based on a form value when a
button is clicked. Directly after the .Update, I call another
function that does some other work and, in the process, queries the
table I just updated for the record I just updated and it does not see
the update I just made.
Jeff,

You probably need to issue a Refresh command somewhere to commit the change,
before calling the 2nd function.

If I run in the debugger the problem doesn't occur. It seems like the
.Update event is not yet completed before the subsequent query is
executing (running in the debugger slows execution down sufficiently
for the update to complete?)

Is this a feasible explanation? Is there a solution?

The table involved is about 10,000 records.

Nov 12 '05 #3

P: n/a
TC
Are the update and the query both running off the same
dbengine.workspace.database reference?

TC
"Jeff Wilson" <jw*********@attbi.com> wrote in message
news:fc*************************@posting.google.co m...
Seeing an odd situation I've not seen before.

Have VB that updates a field in a table based on a form value when a
button is clicked. Directly after the .Update, I call another
function that does some other work and, in the process, queries the
table I just updated for the record I just updated and it does not see
the update I just made.

If I run in the debugger the problem doesn't occur. It seems like the
.Update event is not yet completed before the subsequent query is
executing (running in the debugger slows execution down sufficiently
for the update to complete?)

Is this a feasible explanation? Is there a solution?

The table involved is about 10,000 records.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.