Opening a form while another is working

  • Thread starter jer99 via AccessMonster.com
  • Start date
J

jer99 via AccessMonster.com

I have a Master form that automatically opens when the database is opened. In
the LOAD event, it does a few things that take quite a bit of time.
I have another form (Wait form) that has a scrolling message telling the user
to Please Wait. It uses the Timer property.

My intention was to call the Wait form from the begining of the Master LOAD,
then, when all the time consuming functions were done, check to make sure the
Wait form is still around and close it.

The problem is that the Wait form comes up but is only showing the border of
the form, not the scrolling text. That area is transparent - only when it is
called from the Master. When the Master is finished, the Wait Form
disappears as it should.

What is the best way to have the Wait form appear and show the scrolling text,
have the Master do it's functions and then close the wait form?
 
D

Dirk Goldgar

In
jer99 via AccessMonster.com said:
I have a Master form that automatically opens when the database is
opened. In the LOAD event, it does a few things that take quite a bit
of time.
I have another form (Wait form) that has a scrolling message telling
the user to Please Wait. It uses the Timer property.

My intention was to call the Wait form from the begining of the
Master LOAD, then, when all the time consuming functions were done,
check to make sure the Wait form is still around and close it.

The problem is that the Wait form comes up but is only showing the
border of the form, not the scrolling text. That area is transparent
- only when it is called from the Master. When the Master is
finished, the Wait Form disappears as it should.

What is the best way to have the Wait form appear and show the
scrolling text, have the Master do it's functions and then close the
wait form?

Try something like this:

DoCmd.OpenForm "WaitForm"
Forms!WaitForm.Visible = True
DoEvents

See if that helps.
 
J

jer99 via AccessMonster.com

Thanks Dirk.
I'm getting closer.
The form opens and the background shows, however, the scrolling text (based
 
D

Dirk Goldgar

In
jer99 via AccessMonster.com said:
Thanks Dirk.
I'm getting closer.
The form opens and the background shows, however, the scrolling text
(based on the Timer Event) doesn't happen. It's as if it can't
handle a Timer event and run the functions on the master in the
background.

That's possible -- it will depend on what's going on in the background.
As far as I know, there's only one processor thread for VBA execution.
You may be able to help this by sprinkling DoEvents statements through
the code that's running on the Master form. If you have long-running
loops in VBA code, put a DoEvents statement inside each loop.

If that doesn't help, you may have to give up on making the text scroll.
Just displaying a static "Please Wait" message and setting the cursor to
an hourglass may be good enough.
 
J

jer99 via AccessMonster.com

Yep - I give up.
I'm easy :)

Thanks Dirk

Dirk said:
That's possible -- it will depend on what's going on in the background.
As far as I know, there's only one processor thread for VBA execution.
You may be able to help this by sprinkling DoEvents statements through
the code that's running on the Master form. If you have long-running
loops in VBA code, put a DoEvents statement inside each loop.

If that doesn't help, you may have to give up on making the text scroll.
Just displaying a static "Please Wait" message and setting the cursor to
an hourglass may be good enough.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top