Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using MsgBox without pausing the application

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.

like image 960
Patrick Villela Avatar asked Mar 28 '11 13:03

Patrick Villela


People also ask

How do I stop the Messagebox loop?

Ctrl + Break To break out of a loop, the conventional technique is the keyboard Ctrl + Break combination.

What is the use of MsgBox in VB net?

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.


2 Answers

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
like image 65
Jean-François Corbett Avatar answered Sep 23 '22 06:09

Jean-François Corbett


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).

like image 43
Smandoli Avatar answered Sep 25 '22 06:09

Smandoli