Solved

Problem displaying a status box during a database query

Posted on 2004-04-30
3
151 Views
Last Modified: 2012-05-04
I have an application that pulls data from a large Oracle database. I have a form with various fields the user can enter and a Search button. I would like to display a message telling the user that the program is searching. I have created a form called frmSearchMsg that basically says to please wait. I load frmSearchMsg when the search button is clicked and unload it after the query is finished. The problem is that frmSearchMsg never seems to load complexly. I get the outline and title bar, but the body of the form never loads, i just see what is behind the form. I have tried using the .setfocus and have even put in an empty loop to slow the program down and give it the form time to load, but nothing helps. frmSearchMsg looks fine when I call it by its self. Any Ideas?
0
Comment
Question by:m9s999
3 Comments
 
LVL 19

Accepted Solution

by:
Shauli earned 500 total points
ID: 10963746
Add Doevents where you load the form, as in:

Doevents
frmSearchMsg.Show

S
0
 
LVL 6

Expert Comment

by:prasitlee
ID: 10964175
Hi m9s999,
    You have a lot of ways to use DoEvents to refresh the menu frmSearchMsg.
    - If you have executed your query program by looping
      Do ......
            ....................
            DoEvents
            ....................
      Loop
      You have to insert DoEvents inside the loop.
   - But if the executed command is just a line of code but it took a long time to query, you have to put Timer Control into your form and set the refresh time on it
     Private Sub Time1_Time()
          ....................
          DoEvents
          ....................
     End Sub
     Hopefully it would be helpful.
                                                     Meng
0
 

Author Comment

by:m9s999
ID: 10968626
Calling DoEvents after I show frmSearchMsg seems to fix the problem. Thanks.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

809 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