Status Bar

houseofturner

Registered User.
Local time
Today, 09:06
Joined
Dec 10, 2009
Messages
37
I am using: RetVal = SysCmd(acSysCmdInitMeter, "Preparing Database...", 5) in order to display custom messages on the status bar.

This works fine when I test being able to display this but when queries are running then the standard Status Bar saying Running Query etc over rides my custom status bar.

Is there a way to stop this happening?

Also can you change the text of the status bar using:

RetVal = SysCmd(acSysCmdUpdateMeter, "Preparing Database...", 10) as when I try this it seems to return an error.

Thanks!
 
Actaully I prefer to allow the status bar to show the progress when my queries are running since I cannot duplicate its accuracy.

I use a custom label to display what is happening...

Code:
If CurrentProject.AllForms("frmForm1").IsLoaded Then Forms![frmForm1].[lblStatus].Caption = "Running query 1, please wait..."
Pause (0.1)
DoCmd.OpenQuery "Query1"

If CurrentProject.AllForms("frmForm1").IsLoaded Then Forms![frmForm1].[lblStatus].Caption = "Running query 2, please wait..."
Pause (0.1)
DoCmd.OpenQuery "Query2"

The below Pause code is required to allow the caption of the label to be visually updated before the next step begins. The sleep function will not do that.

Code:
Public Function Pause(NumberOfSeconds As Variant)
On Error GoTo Err_Pause

    Dim PauseTime As Variant, start As Variant

    PauseTime = NumberOfSeconds
    start = Timer
    Do While Timer < start + PauseTime
    DoEvents
    Loop

Exit_Pause:
    Exit Function

Err_Pause:
    MsgBox Err.Number & " - " & Err.Description, vbCritical, "Pause()"
    Resume Exit_Pause

End Function
 
Also can you change the text of the status bar
Each control has a StatusBarText property. You can use that.
 
a short answer to your question - no.
it will show the "running query..." message when when queries are running.

as vbaInet said - using the StatusBarText property of the control is the easieast way to set the status bar text.
 
Thinking about it, I think you can turn it off. I vaguely remember reading something regarding that. I will get back to you on that.
 
You can also use the
DoCmd.Echo "Status bar message ", True

Whist performing operations that do not require a progress bar
 
Just a thought, it could be that in place of the meter Access is displaying the text but via the same class. Try removing the meter before you run your query:

Code:
Application.Syscmd acSysCmdRemoveMeter
 

Users who are viewing this thread

Back
Top Bottom