I have already posted a question about updating the status bar while running queries in MS Access 2010. Please see How to show progress on status bar when running a sequence of
Call DoEvents after each SysCmd call. That will signal Windows to update the display before your code advances.
In this function, each status bar message is visible before the next is displayed.
Function PutMessageInStatusBar2()
Const lngMilliseconds As Long = 1000
SysCmd acSysCmdSetStatus, "Before loop 1"
DoEvents
Sleep lngMilliseconds
SysCmd acSysCmdSetStatus, "Before loop 2"
DoEvents
Sleep lngMilliseconds
SysCmd acSysCmdSetStatus, "Before loop 3"
DoEvents
Sleep lngMilliseconds
SysCmd acSysCmdSetStatus, "Done."
DoEvents
Sleep lngMilliseconds
SysCmd acSysCmdClearStatus
End Function
Sleep is based on a Windows API method and is declared in the Declarations section of a standard module:
Option Compare Database
Option Explicit
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)