Form displays as "see through" on load!

C

Chrisso

Hi All

I have a form that tells the user that the DB is updating. When I view
it in form mode from the database window it displays perfect.

However - when I open it from a sub in a module it displays the forms
border but that is all - the frame appears but the entire form is
missing and you can the see the background form inside the border!

I can only make it display properly with this code using a repaint:

' tell the user what is happening:
DoCmd.OpenForm "frmTADUpdating"
DoCmd.RepaintObject acForm, "frmTADUpdating"

What the £%^& is going on? This seems perverse to me!

Thanks in advance for any ideas,
Chrisso
 
T

Tom van Stiphout

On Sun, 16 Aug 2009 01:21:58 -0700 (PDT), Chrisso

RepaintObject may not be the right choice. I think DoEvents would be
better.

-Tom.
Microsoft Access MVP
 
B

Bob Quintal

m:
Hi All

I have a form that tells the user that the DB is updating. When I
view it in form mode from the database window it displays perfect.

However - when I open it from a sub in a module it displays the
forms border but that is all - the frame appears but the entire
form is missing and you can the see the background form inside the
border!

I can only make it display properly with this code using a
repaint:

' tell the user what is happening:
DoCmd.OpenForm "frmTADUpdating"
DoCmd.RepaintObject acForm, "frmTADUpdating"

What the £%^& is going on? This seems perverse to me!

Thanks in advance for any ideas,
Chrisso

I agree with tom that a DoEvents statement
immediately following the openform command is a better solution.

I suspect that what is happening is
1) you start to open the form, which probably contains a bitmap as
the background. Access calls Windows functions to paint the form as
an asynchronous process.
2) you immediately start a tight loop or a complex query, which
consumes all available CPU cycles. so the background process of
opening the form stalls.

The DoEvents statement is designed specifically to handle the issue
of asynchronous processes.
 

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