display progress msg on screen

klnlsu

Registered User.
Local time
Today, 08:41
Joined
Jun 13, 2013
Messages
19
I want to display the message "Processing Record ? of ???..." on the screen while my vba code is running without interruption. Since the msgbox requires the user to click a button to continue, what is the simplest way to display this message on the screen without interrupting the program or requiring user interaction?
 
you could use a StatusBar sub/function with a variable that keeps track of the current record number like this:

StatusBar "Processing Record " & i & " of " & rs.RecordCount & " ..."

Sub StatusBar(pstrStatus As String)

Dim lvarStatus As Variant

If pstrStatus = "" Then
lvarStatus = SysCmd(acSysCmdClearStatus)
Else
lvarStatus = SysCmd(acSysCmdSetStatus, pstrStatus)
End If

End Sub


Where i is a counter which gets incremented with each new record of your recordset object such as rs

when you've finished the recordset don't forget to reset the status bar with
StatusBar ""

David
 
That worked great! Thanks!
 

Users who are viewing this thread

Back
Top Bottom