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

Display form during query

Status
Not open for further replies.

bmoremu

Programmer
Dec 22, 2003
38
US
I have a SQL query set to run and return a recordset from Access to Excel. When the user hits the 'Search' button on the form I hide the search form and would like a small 'Please wait...' form to display while the query is running and then close when the results are returned to Excel. My problem is, I have a loop on the wait form changing the number of '.' after 'Please wait' so that the user knows the query is running. So I'm having trouble having that caption loop run AND the query run in the background simultaneously. Any advice would be much appreciated, thanks!
 
Unless you want to play around with modeless forms (which are only available in the latest versions of MS Office), you won't be able to move the focus off of your first form until your code stops running.

Why not just reconfigure the appearance of your form to display your "Please Wait" message? For example, you could have a multi-page control on your form, and while the query is running you could display the second page (which would have your message on it). Or you could get into showing/hiding controls, resizing the form, etc. Either way, the form containing the code still has the focus, and everybody is happy.

VBAjedi [swords]
bucky.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top