Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a "Please standby . . ." pop up?

Status
Not open for further replies.

Ymesei

MIS
Jul 25, 2000
44
GU
What would be the best way to create a message box using VBA that will pop up when a procedure begins running that tells the user to wait . . . Then closes when the procedure completes. So the user doesn't think the app is hanging.[hourglass] I tried using the msgbox function, but it seems to always want to have the OK button. I guess that would be wrong because I don't need the form to return a value anyway.

I'm trying to find a way to do it without having to create a new form in my app and call that form from VBA.

Thanks in advance.

Will
 
I have posted an example at called CustomMessageBox.zip import the File "frmCustomMessageBox" from the Access 97 or 2000 DB into your own DB. Add your own Message, Icons or Images to "frmCustomMessageBox".

To use the Form in your code:

DoCmd.Open acForm, "frmCustomMessageBox"

'Code to Run your Procedure(s)
DoCmd.Close acForm, "frmCustomMessageBox"


NB. This is a VERY basic example which as you become more experienced with VBA you can develop further and make more dynamic.

Regards

Bill
 
Bill,

Thanks for that suggestion. I was actually looking to see if there was a way of creating a pop up form without having to create a new form in my app.

Kinda like using the code below to have your code pause until the user acts on the pop up window. But I don't want the OK button the on the pop up form.

Msgbox("Click OK to Continue",vbOKOnly)

Thanks,
Will
 
Sorry, didn't take in the last line. Don't take my word for it, but I think MsgBox suspends Access Operations until it receives a Response.

Do a search on Tek-Tips, there are often questions on Message Boxes.

Good Luck.

Bill
 
If you have a form open, and that form has enough space, you can add a big text box with the message.

Set the text boxes .visible to false so it's not visible when the form starts. When you begin the lengthy procedure, simply set the text box's .visible to true. And then make it invisible at the end of your procedure.

In addition, you can set the cursor style so that while the procedure executes, the cursor will look like the hour glass.

DoCmd.Hourglass True
procedure code
DoCmd.Hourglass False



 
Yes. I realize that using Msgbox won't work for what I'm looking for. I was hoping there was some function that would create a pop up form that I could close programatically without having to create a form in my app as in your example.

In hindsight, that doesn't make any sense. Why create a function that doesn't return a value? [ponder]

Thanks anyway.
 
Dataguy,

Thanks for your suggestion. I already have the cursor as an hourglass. Also, the operation is fired from a menu item and it opens an email form using the user's mail client, so there isn't an active form that I can use to display the message.

Guess I'm stuck with having to create another form.

Thanks for all your suggestions, everyone.

Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top