I need to display a message to the user. When I do this using MsgBox
, the program stops until the user clicks the box away. I'd like to know if there's a way to open the MsgBox
without pausing the program.
Ctrl + Break To break out of a loop, the conventional technique is the keyboard Ctrl + Break combination.
Example. This example uses the MsgBox function to display a critical-error message in a dialog box with Yes and No buttons. The No button is specified as the default response. The value returned by the MsgBox function depends on the button chosen by the user.
Sounds like you're not expecting any user input from the MsgBox. In this case, depending on your application, the StatusBar
may be an adequate substitute.
In Excel this is easy:
Application.StatusBar = "Please be patient..."
Application.StatusBar = iDone & " of " & iTotal & " items done."
To clear the StatusBar when done:
Application.StatusBar = False
In Access, the syntax is a tiny bit more convoluted:
Temp = SysCmd(acSysCmdSetStatus, "Hey, look at me!") ' Puts out your message
Temp = SysCmd(acSysCmdClearStatus) ' Clears StatusBar
As far as I've ever been able to discover, the answer is you can't. The work-around is a custom form that serves as a dialog box.
See http://www.mvps.org/access/forms/frm0046.htm (not precisely your question, but applicable).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With