Repost: OpenForm Does Not Update Embedded Query

S

SteveM

Hi Steve
If anybody has anything but schadenfreude about my troubles, here's a
twist.  I inserted a pause using the Timer function between the
Optimization completion and the opening of the Pivot Form that uses
the Solution table.  The problem goes away if I insert a delay of at
least 4 seconds.  So evidently Access needs to clean up after the
Optimizer has left.  But 4 seconds is a long time.
Can I force Access to do its business immediately with a command/
method?

In place of your timer, try using:

    DBEngine.Idle dbRefreshCache

Also, if you have any control over the function of the Optimizer, make sure
that it is using a transaction to update the database.  CommitTrans will
flush pending writes and release locks.

--
Good Luck  :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Graham,

Thanks a ton. Unfortunately:

DBEngine.Idle dbRefreshCache

Does not work. The Optimizer does have a "Use Transactions" switch
and it is set to On.

So the Schadenfreude...

SteveM
 
D

david

You can try using registry changes, to force the Optimiser to
write to the database, but that will have to be done on every
computer where the application is used.

Or you can just stick with the timer.

If you decide to make registry changes, the place to look is
HKLM\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0

You want to set the AsyncDelay, Transaction timeout, and Shared
AsyncDelay to 1, and ImplicitCommitSync to yes

Dunno if any if those will help. Those are for the Optimiser side.
On the application side, you need to keep the

Application.DBEngine.Idle dbRefreshCache

as well.

(david)

Hi Steve
If anybody has anything but schadenfreude about my troubles, here's a
twist. I inserted a pause using the Timer function between the
Optimization completion and the opening of the Pivot Form that uses
the Solution table. The problem goes away if I insert a delay of at
least 4 seconds. So evidently Access needs to clean up after the
Optimizer has left. But 4 seconds is a long time.
Can I force Access to do its business immediately with a command/
method?

In place of your timer, try using:

DBEngine.Idle dbRefreshCache

Also, if you have any control over the function of the Optimizer, make
sure
that it is using a transaction to update the database. CommitTrans will
flush pending writes and release locks.

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Graham,

Thanks a ton. Unfortunately:

DBEngine.Idle dbRefreshCache

Does not work. The Optimizer does have a "Use Transactions" switch
and it is set to On.

So the Schadenfreude...

SteveM
 
D

david

You can try using registry changes, to force the Optimiser to
write to the database, but that will have to be done on every
computer where the application is used.

Or you can just stick with the timer.

If you decide to make registry changes, the place to look is
HKLM\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0

You want to set the AsyncDelay, Transaction timeout, and Shared
AsyncDelay to 1, and ImplicitCommitSync to yes

Dunno if any if those will help. Those are for the Optimiser side.
On the application side, you need to keep the

Application.DBEngine.Idle dbRefreshCache

as well.

(david)

Hi Steve
If anybody has anything but schadenfreude about my troubles, here's a
twist. I inserted a pause using the Timer function between the
Optimization completion and the opening of the Pivot Form that uses
the Solution table. The problem goes away if I insert a delay of at
least 4 seconds. So evidently Access needs to clean up after the
Optimizer has left. But 4 seconds is a long time.
Can I force Access to do its business immediately with a command/
method?

In place of your timer, try using:

DBEngine.Idle dbRefreshCache

Also, if you have any control over the function of the Optimizer, make
sure
that it is using a transaction to update the database. CommitTrans will
flush pending writes and release locks.

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Graham,

Thanks a ton. Unfortunately:

DBEngine.Idle dbRefreshCache

Does not work. The Optimizer does have a "Use Transactions" switch
and it is set to On.

So the Schadenfreude...

SteveM
 
S

SteveM

In place of your timer, try using:
    DBEngine.Idle dbRefreshCache
Also, if you have any control over the function of the Optimizer, make sure
that it is using a transaction to update the database.  CommitTrans will
flush pending writes and release locks.
Graham Mandeno [Access MVP]
Auckland, New Zealand

Graham,

Thanks a ton.  Unfortunately:

DBEngine.Idle dbRefreshCache

Does not work.  The Optimizer does have a "Use Transactions" switch
and it is set to On.

So the Schadenfreude...

SteveM

Wait! It does work!

Thank you! Thank you! Thank you!

I am standing on the shoulders of giants!

SteveM
 
S

SteveM

In place of your timer, try using:
    DBEngine.Idle dbRefreshCache
Also, if you have any control over the function of the Optimizer, make sure
that it is using a transaction to update the database.  CommitTrans will
flush pending writes and release locks.
Graham Mandeno [Access MVP]
Auckland, New Zealand

Graham,

Thanks a ton.  Unfortunately:

DBEngine.Idle dbRefreshCache

Does not work.  The Optimizer does have a "Use Transactions" switch
and it is set to On.

So the Schadenfreude...

SteveM

Wait! It does work!

Thank you! Thank you! Thank you!

I am standing on the shoulders of giants!

SteveM
 
G

Graham Mandeno

Hi Steve
Wait! It does work!

Thank you! Thank you! Thank you!

I am standing on the shoulders of giants!

SteveM

No, not giants - just little guys who, like you, are trying to make sense of
it all. Maybe some of us have been at it longer than others :)

I'm very glad you've got it working!
 
G

Graham Mandeno

Hi Steve
Wait! It does work!

Thank you! Thank you! Thank you!

I am standing on the shoulders of giants!

SteveM

No, not giants - just little guys who, like you, are trying to make sense of
it all. Maybe some of us have been at it longer than others :)

I'm very glad you've got it working!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top