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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display a message when a process is running

Status
Not open for further replies.

rushdib

Programmer
Jun 12, 2001
203
US
Hi,
I would like to know how to display a small message (message box without a prompt) to inform a user to wait until the process finishes. I tried using a pop-up form, but that doesn't work. Is there a way to display a MsgBoz without the prompt from the user and can be controlled from the code in the VBA?

Thank You,

Rushdi
 
rushdi,
By 'Without the prompt', what do you mean? No button? no message? It seems a modal form would work here, if you want to completely prevent a user from doing anything else while your code is running. In the forms properties, be sure to remove the ControlBox, besides making it modal. Then, by all means, don't forget to close the form programatically in error handlers as well as in the spot where you normally would close it.
--Jim
 
Hi Jim,
It didn't work. What I have is a small simple form which has two labels which says "process running please wait" and the control box property is turned off and modal property is turned on. I tried changing the pop-up property also. When I run the process, the form appears but the labels disappears. Is there any other way that I can display this message rather than using a form?

Thanks,

Rushdi
 
How about changing the mouse pointer to an Hourglass?
Code:
DoCmd.Hourglass True
to turn it on, and
Code:
DoCmd.Hourglass False
to turn it off.....
 
An alternative to displaying a form is to use the status line at the bottom left corner of the main screen. For example,
Code:
Dim Result

Result = SysCmd(acSysCmdSetStatus, "Process running, please wait...")

'Do your routines

Result = SysCmd(acSysCmdClearStatus)
Otherwise, you'll need to use a form to display your message. I would suggest that you NOT open it modal, but open it as pop-up (it won't have the focus, but it will be visible on top of other forms) and put a timer interval and event handler on it to check the status of your procedures every so often, say once per couple of seconds. A simple way to do that is to use a Public variable in a module to track and communicate the status between your procedures and the status form. At a complicated, multi-user/SQL Server database level you could use status tables with your stored procedures to record their progress and then read the status tables in your pop-up status form to display the progress. No matter what method you use, the form would close itself when the status is complete.
 
it's a timing thing...... I've been able to display the form with the message by attaching the code to open it to the Mouse Down Event of the Command Button, and the rest of the code that gets performed to the On Click event of the Command Button.

PaulF
 
rushdi,
Have you tried DoEvents just after the OpenForm?
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top