How to force a repaint of a second form in Access 2K

S

SuperScooper

I have an Access 2k database with two forms. The purpose of the first
form is to present database details in various listbox controls (ie,
names/numbers of queries, forms, tables, etc).

The contents of the listboxes are generated each time a button on the
form is pressed.

The problem I'm having is that often the code takes a fair bit of time
to load each of the listboxes.

I want to provide the user with some feedback in terms of what is
going on after the button is pressed.

Therefore...

After pressing the button I cause a second form to open. This form
has various text controls that I update with code to let the user know
what is going on.

All the code for loading the listboxes and updating the text controls
of the second form exists in the form module of the first form.
(There is no code embedded on the form module of the second form.)

The issue however is that although the second form opens, my calls to
repaint the form have no effect.

eg, From the code module on Form 1

Forms.Item("Form2").Caption = "Loading Database"
Forms.Item("Form2")!txtFoundForms.Value = lngForms
Forms.Item("Form2").Repaint

I've also tried...

Forms!Form2.Caption = "Loading Database"
Forms!Form2!txtFoundForms.Value = lngForms
Forms!Form2.Repaint

Any thoughts or ideas?

Thanks in advance.

- Michael
 
D

Dan Artuso

Hi,
Not sure how you're 'loading' everything, but if you have loops, try putting a DoEvents
in there to allow Access to refresh things.
 
S

SuperScooper

Hi,
Not sure how you're 'loading' everything, but if you have loops, try putting a DoEvents
in there to allow Access to refresh things.

Thanks for the feedback. It seems the issue was with where I had
placed the repaint method. Placing it elsewhere seems to have
corrected the issue.

Thanks for the help.
 

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