Question Prograss Meter VBA 2007 - no visual

antonio.manoj.derose

Registered User.
Local time
Tomorrow, 03:42
Joined
Jul 4, 2013
Messages
62
'this is my progress bar, coding I am able to see the code is working
'when I put a bullet point
'issue is the progress bar is not visualizing

Option Compare Database
Option Explicit

Public Sub ProgressMeter100()
Dim MyDB As DAO.Database, MyTable As DAO.Recordset
Dim Count As Long
Dim Progress_Amount As Integer

Set MyDB = CurrentDb()
Set MyTable = MyDB.OpenRecordset("tblpayments")
' Move to last record of the table to get the total number of records.
MyTable.MoveLast
Count = MyTable.RecordCount
' Move back to first record.
MyTable.MoveFirst
' Initialize the progress meter.
SysCmd acSysCmdInitMeter, "Reading Data...", Count
' Enumerate through all the records.
For Progress_Amount = 1 To Count
' Update the progress meter.
SysCmd acSysCmdUpdateMeter, Progress_Amount

'Print the contact name and number of orders in the Immediate window.
'Debug.Print Progress_Amount 'MyTable![ContactName]; _
'DCount("[OrderID]", "Orders", "[CustomerID]='" & MyTable![CustomerID] & "'")

' Go to the next record.
MyTable.MoveNext
Next Progress_Amount
' Remove the progress meter.
SysCmd acSysCmdRemoveMeter

End Sub
 
Are you sure - look to the right side of the status bar.
attachment.php
 

Attachments

  • StatusBar.jpg
    StatusBar.jpg
    4.9 KB · Views: 244
Hi JHB,

Thanks for your reply, you know, I was not able to view it, until you mentioned it that there is something.

But I enforced a delay, by calling the sleep method.

Finally I was able to witness, with the clearer and lengthier view.

unfortunately this is not what I want, a professional progress bar, customary one.

Can you help me, by the way is threads allowed in VBA Access

Thanks,

Antonio
 
try adding a DoEvents after the update, without the DoEvents the screen updates stop happening. It will slow down your code somewhat but will update your screen.
 
Hi JHB,
unfortunately this is not what I want, a professional progress bar, customary one.

Try the meters in this database.

For what you want, you would just need to grab clsMeter and frmMeter. The test form shows how to run them.

If you need the dual meter for anything, just grab clsDualMeter - it will build its own form the first time it's run. Sorry, never got around to adding that code to clsMeter.

Keep in mind that my meters CANNOT show the progress of action queries - if there's a way to update those in a manual meter, I haven't found it yet.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom