Incorrect display

M

Moff

Hi,
When I start my program (Access 2007), I use a form with a background
picture and nothing else, while the program makes some work (50 seconds) with
the data. This work is invisible to the user. The problem is the form don't
display correctly. I found a temporary solution that I don't like. I force a
message to be written to the form with MsgBox. Then the form and the
background picture are ok. Is it another way to achieve that without using
MsgBox (because the user must clic on it to close it) ?
I use these two lines of code followed by some invisible work to the data.

DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.Maximize
....
invisible work to the data

Thank you!
 
K

KS

Please try the following:-

in Form_Load() event
me.TimerInterval = 50000
Doevents
<the code you want to run in background>

in Form_Timer() event
docmd.openform <the main form you want to display>
docmd.close acform, me.name

HTH
KS
 
M

Marshall Barton

Moff said:
When I start my program (Access 2007), I use a form with a background
picture and nothing else, while the program makes some work (50 seconds) with
the data. This work is invisible to the user. The problem is the form don't
display correctly. I found a temporary solution that I don't like. I force a
message to be written to the form with MsgBox. Then the form and the
background picture are ok. Is it another way to achieve that without using
MsgBox (because the user must clic on it to close it) ?
I use these two lines of code followed by some invisible work to the data.

DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.Maximize
...
invisible work to the data


I haven't used A2007 yet, but I suspect that adding one or
two DoEvents will make the message box unecessary.
 
M

Moff

Yes the following code works !
me.TimerInterval = 50000
Doevents
Thank to both of You!
 

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