View Full Version : Message to appear until query has run.


chrisjrice
06-18-2002, 05:50 AM
I want to display a please wait message on the screen until a query or print preview has completed.

I have an access form where a user selects a query using a combo box and then clicks on a command button to run the query. Some of the queries take a few minutes to run, and though an hour glass does appear whilst it is running I would also like to display a message or even better a status bar!

I am very familiar with VBA & VB so any technical help would be much appreciated.

Thanks

Chris Rice

crosmill
06-18-2002, 06:12 AM
Bulid a form " The query is Running"

OnClick of the combo box run a macro to open the form, run the query, close the form.

you'll probably need to repaint the form when it opens.

chrisjrice
06-18-2002, 06:19 AM
Many thanks for your speedy reply, I would have never thought of trying it this way, I was looking at a more complicated picture.

Thank you, I will give this a try. (Is there anyway this can be adapted to show a status bar?)

PS (How do you repaint a form?).

Chris Rice

crosmill
06-18-2002, 06:23 AM
I fell accross this before

might of use to you, the only progress bars I've used are Flash Preloaders

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=30028

chrisjrice
06-20-2002, 04:09 AM
Thanks for your time once again.

I am having a problem however. The query will not run until the form is closed on screen. The form with the message appears and then nothing happens until I close the form.

In the macro I had

Open Form
Run Query
Repaint Form
Close Form

I then tried doing it in VBA instead.

I done a Docmd.openform then a docmd.openquery and then a docmd.close

The same thing happens.

Any idea??

Thanks

Chris

crosmill
06-20-2002, 04:14 AM
Which form is locking it?

is it the "running query" form or the form you click to run the macro?

if it's the latter use the macro to close that form and then reopen it again at the end.

chrisjrice
06-20-2002, 04:20 AM
I have a main form with a command button which runs the macro when clicked on. The macro needs to open the message form and then run the query. What is happening is that the Macro is opening the message form but not running the query. It seems to just stop after the message form has been opened, until you manually close the message form on the screen. Once you manually close the form the macro then carries on and opens the query.

Hope that makes more sense.

crosmill
06-20-2002, 04:23 AM
You need to have the macro order like this

Open Form
Repaint Form
Run Query
Close Form


Give that a go!

chrisjrice
06-20-2002, 04:30 AM
Magic!!!! It worked... Thanks very much for all your time. You are a star.

Cheers

Chris