Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flashing progressbar

Status
Not open for further replies.

flaviooooo

Programmer
Feb 24, 2003
496
0
0
FR
Hey,

one of our forms contains a button to run several queries, one after the other. In the status bar, the people would see several progressbars start over and over, as the queries flash by. They would not have a clue when this would end.

To make things a bit more convenient, I have tried to ad a homemeade progressbar in the status bar, so they could see exactly when it was going to stop.

I did this as such:

Code:
Dim countrecs As Long
Dim msg As String
Dim returnvalue As Variant
Dim x As Long

'Creation of progressbar
'Parameters progressbar
countrecs = 4
msg = "UPDATING ..."
Application.SysCmd acSysCmdInitMeter, msg, countrecs
Application.SysCmd acSysCmdUpdateMeter, 1

DoCmd.SetWarnings False

query
query
query
    Application.SysCmd acSysCmdUpdateMeter, 2
        
query
query
query
    Application.SysCmd acSysCmdUpdateMeter, 3

query
query
query
    Application.SysCmd acSysCmdUpdateMeter, 4 
    
DoCmd.SetWarnings True

returnvalue = SysCmd(SYSCMD_REMOVEMETER)

msg = MsgBox("UPDATE DONE", vbOKOnly)

THe progressbar shows the progress as it should, but unfortunately it seems to flash away everytime a new query starts? So half of the time, the status bar is empty and this is probably even more annoying than how it used to be...

Anyone have an idea on how to solve this??

Thanks in advance

Fabian
 
Both the queries and your code are using the same object, so another solution would be to use an ActiveX ProgressBar (and possibly hide the status bar temporarily).

There's one in MSComctlLib (C:\WINDOWS\system32\MSCOMCTL.OCX
or similar) which is probably already on your system. Make sure ther's a reference to this file in the VBE. Then add the control to your form by opening in design view and from the drop-down menu:
Insert>ActiveX Control

In the Insert ActiveX dialogue box select Microsoft Progress Bar Control Version [X] and bob's your uncle.

The progress bar control doesn't have many properties so it'll be easy to suss out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top