?
Solved

Busy Signal 200 POINTS

Posted on 1999-12-19
17
Medium Priority
?
154 Views
Last Modified: 2010-05-02
I have a function which takes about 8 or 9 seconds to finish loading. What i would like is a "working code" example of how to make a little message box or something which would state "working please wait" until the function was through. Don't really want a message box because you have to click the OK Button. Just want it to do this while working and then quitely disappear. Got more points if this is too hard peoples.
Thanks
rockroad
0
Comment
Question by:rockroad
  • 6
  • 4
  • 4
  • +2
17 Comments
 
LVL 7

Expert Comment

by:Vbmaster
ID: 2294080
What about creating a dummy form for this, with just a label saying "Have patience.. Calculating some really hard stuff". Whenever you want to show the form you can use TheDummyForm.Show and hide it with code like Unload TheDummyForm.
0
 

Author Comment

by:rockroad
ID: 2294122
Vbmaster--You got something like this to show me? I'm not that great at programming with vb 5.0
For instance, the first question that comes to my "peabrain" is how/when will the dummyform know when the other function is finished ? Anyway, if you have something to add i will be waiting!
Thanks
rockroad
0
 
LVL 3

Accepted Solution

by:
pacificdb earned 800 total points
ID: 2294133
1. Create a small form with no buttons. Set its Height property to zero. Set the form Caption to "Working. Please Wait...", or some such message.

2. Create a global Sub as follows:

   Public Busy(intStatus as Boolean)
      If intStatus then
          Working.Show
      Else
          Unload Working
      End If
   End Sub

3. Call Busy(True) when you enter your lengthy function, and Busy(False) when you exit it.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 3

Expert Comment

by:pacificdb
ID: 2294135
By the way, set the form's Name property to "Working".
0
 

Author Comment

by:rockroad
ID: 2294180
pacificdb--thanks for your comment. I tried your code and got an error:

Public Working(intStatus as Boolean) gives the error and "as" is highlighted?

I'm using visual basic 5.0
I tried placing the code into my form and also is a module and got the same error when i tried to run the program. Any help on this ?
Thanks
rockroad
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2294615
try
Public sub Busy(intStatus as Boolean)
                                                  If intStatus then
                                                      Working.Show
                                                  Else
                                                      Unload Working
                                                  End If
                                               End Sub

he left the sub bit out
0
 
LVL 3

Expert Comment

by:pacificdb
ID: 2294719
Thanks crazyman, it's always the simple stupid mistakes isn't it ;->
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2294934
Hehe sure is .
Oh and rockroad if that is what you wanted please give the points to pacificdb as his answer was correct he just missed out one word.
Thanks.
0
 

Author Comment

by:rockroad
ID: 2295164
Hey crazyman and Pacificdb--all worked fine after the missing word was fixed. Please leave instructions on how to award the points since this was only commmented. I am new to the new system here!
Thanks to both of you!!!
rockroad
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2295392
Just throwing my 2 cents in...

You may actually have to do this:


Public sub Busy(intStatus as Boolean)
   If intStatus then
       Working.Show
       Working.Refresh
       DoEvents
   Else
       Unload Working
   End If
End Sub


Otherwise, the system may not allocate enough resources to properly paint the Working screen when you show the form...


Cheers!
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2295416
Just click on accept comment as answer on one of Pacificdb questions that will give him the points
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2295423
i mean on one of his comments not questions
0
 

Author Comment

by:rockroad
ID: 2295709
Hey you guys, mcrider, you were right about your code too ! Thanks to all and sorry about no points for some of you. You all participated !!!

Thanks
rockroad
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2295738
So who are you going to award the points to??


Cheers!
0
 

Author Comment

by:rockroad
ID: 2295932
pacificdb gets the points because he listed the original code. I hope everyone agree's with this.
Thanks
rockroad
0
 

Author Comment

by:rockroad
ID: 2295938
Thanks Again pacificdb !!!
rockroad
0
 
LVL 3

Expert Comment

by:pacificdb
ID: 2299765
We're here to help :-)
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question