Progress Meter

L

LakeDistrict Man

Hi All, I have searched the site for this topic and come back with some feed
back however I am sure I have done thigs right but still no luck getting this
thing to work...
Ok I have imported the acbUpdateMeter and associated Module etc, the test
form it has with it works OK however my problem is that when I try to use it
in my own app it wont work correctly, I have a number of Queries I run along
with some other bits etc, I have set the BlMeter bit after each query but it
does not do anything when I run the code until the 100% point,
Example of code =
Public Function Import()
DoCmd.SetWarnings False

Dim stDocName As String
Dim blMeter As Boolean

Call acbInitMeter("Import Progress", False)

'Import New "Wl_Final" Table
DoCmd.TransferDatabase acImport, etc etc etc
blMeter = acbUpdateMeter(3)

DoCmd.TransferDatabase acImport, etc etc etc
blMeter = acbUpdateMeter(6)

'Run "Update Age " Query
CurrentDb.Execute "Update Age", dbFailOnError
blMeter = acbUpdateMeter(9)

'Run "TCIFlag_With " Query
CurrentDb.Execute "TCIFlag_With", dbFailOnError
blMeter = acbUpdateMeter(12)

'Run "TCIFlag_Without " Query
CurrentDb.Execute "TCIflag_without", dbFailOnError
blMeter = acbUpdateMeter(15)

'Run "Update time_band A" Query
CurrentDb.Execute "Update time_band A", dbFailOnError
blMeter = acbUpdateMeter(18)

and so on and so on....

Can anyone spot where I am going wrong,

Cheers In Advance
 
M

Marshall Barton

LakeDistrict said:
Hi All, I have searched the site for this topic and come back with some feed
back however I am sure I have done thigs right but still no luck getting this
thing to work...
Ok I have imported the acbUpdateMeter and associated Module etc, the test
form it has with it works OK however my problem is that when I try to use it
in my own app it wont work correctly, I have a number of Queries I run along
with some other bits etc, I have set the BlMeter bit after each query but it
does not do anything when I run the code until the 100% point,
Example of code =
Public Function Import()
DoCmd.SetWarnings False

Dim stDocName As String
Dim blMeter As Boolean

Call acbInitMeter("Import Progress", False)

'Import New "Wl_Final" Table
DoCmd.TransferDatabase acImport, etc etc etc
blMeter = acbUpdateMeter(3)

DoCmd.TransferDatabase acImport, etc etc etc
blMeter = acbUpdateMeter(6)

'Run "Update Age " Query
CurrentDb.Execute "Update Age", dbFailOnError
blMeter = acbUpdateMeter(9)

'Run "TCIFlag_With " Query
CurrentDb.Execute "TCIFlag_With", dbFailOnError
blMeter = acbUpdateMeter(12)

'Run "TCIFlag_Without " Query
CurrentDb.Execute "TCIflag_without", dbFailOnError
blMeter = acbUpdateMeter(15)

'Run "Update time_band A" Query
CurrentDb.Execute "Update time_band A", dbFailOnError
blMeter = acbUpdateMeter(18)

and so on and so on....


I have no knowledge of the acbUpdateMeter function, but,
assuming it does something to change some value(s) on a
form, the problem may be that the screen painting process is
not getting enough time to paint the updated value(s). The
screen painting process runs at a lower priority than VBA
code execution so it ends up waiting until the code has
completed.

If that's what's going on, you can try to give up some time
by adding one (or more?) DoEvents statements after each
acbUpdateMeter call, maybe with a Repaint tossed into the
mix.

Try 1:
blMeter = acbUpdateMeter(n)
DoEvents

Try 2:
blMeter = acbUpdateMeter(n)
Me.Repaint
DoEvents

Try 1:
blMeter = acbUpdateMeter(n)
DoEvents
Me.Repaint
DoEvents

If none of those attempts takes care of it, IME you may be
out of luck because Access/Windows is too busy to get around
to low priority tasks like redrawing your form.
 

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

Similar Threads


Top