Progression bar

M

Maracay

Hi Guys,

I have a process that take a while running about 30 minutes, What I want is
to create something like a progression bar to tell people that the program
is running, what is the program doing and how much left to finish the process.

Any help will be appreciated.

Thanks
 
S

Stefan Hoffmann

hi,
I have a process that take a while running about 30 minutes, What I want is
to create something like a progression bar to tell people that the program
is running, what is the program doing and how much left to finish the process.
I would use a form with at least one lable, e.g.

Public Property Let ProgressMessage(AValue As String)

yourLabel.Caption = AValue
Me.Repaint

End Property


Then you can use it in your long running code as:

Forms("yourForm").ProgressMessage = "doing something..."
'your code here
Forms("yourForm").ProgressMessage = "doing something else..."
'your other code here.

Otherwise you may use the SysCmdMeter with an recordset loop:

Dim rs As DAO.Recordset

Set rs = CurrentDb.OpenRecordset("tableOrQueryOrSQL")
If Not rs.Bof And Not rs.Eof Then
SysCmd acSysCmdInitMeter, "Lengthy operation in progress...", 100
rs.MoveLast ' Ensure to get the correct record count.
rs.MoveFirst
Do While Not rs.Eof
SysCmd acSysCmdUpdateMeter, rs.PercentPosition
'do something complicated with the current record.
rs.MoveNext
Loop
SysCmd acSysCmdRemoveMeter
End If
rs.Close
Set rs = Nothing

mfG
--> stefan <--
 

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