Solved

Problem displaying a status box during a database query

Posted on 2004-04-30
3
149 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now