Progress Bar/Status Bar

speedosteve

New member
Local time
Today, 14:51
Joined
Mar 15, 2004
Messages
4
I have developed several applications in code which take anywhere from 15-30 minutes to run, depending on the amount of data and local server traffic. I would like my clients to be able to tell that their process is actually running through some kind of "percentage complete" status bar or progress indicator, rather than their computer sitting there with an hourglass visible for what seems like forever. I would like to set this up where it runs from the form which triggers the code or the like.....any easy way to set this up or any code repository make this easier?

Thanks. Happy new year to all!!
 
I found this very useful (taken and adapted from: meadinkent.co.uk/astatus.htm)

Controlling the Access status bar



While your visual basic procedures are running it is helpful to give users some information about what is happening during any apparent pauses caused by data processing. Messages can be displayed in the gray bar at the bottom of the Access program window, controlled by a VBA procedure. This program (called StatusBar) simply applies the appropriate code in a more memorable and recognisable format.



It can then be used in other procedures as shown in the three following examples:

StatusBar "Uploading payroll file ..."

or

StatusBar " "

or

StatusBar



The second and third examples both clear the message and return control to normal Access system messages.


Place the following visual basic code in a Module:

Code:
Sub StatusBar(Optional Msg As Variant)
Dim Temp As Variant
' if the Msg variable is omitted or is empty, return the control of the status bar to Access
If Not IsMissing(Msg) Then
 If Msg <> "" Then
  Temp = SysCmd(acSysCmdSetStatus, Msg)
 Else
  Temp = SysCmd(acSysCmdClearStatus)
 End If
Else
  Temp = SysCmd(acSysCmdClearStatus)
End If
End Sub


Now you can use it whenever needed. Here is some code to call the above mentioned on a form when it loads:

Code:
Private Sub Form_Load()
StatusBar "Welcome to the app"
End Sub



 

Users who are viewing this thread

Back
Top Bottom