Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

How Do I Get The Screen To Repaint?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
egun - 25 Jul 2007 21:50 GMT
I have a form that has a bunch of option boxes.  The user selects the options
desired, and hits the "Go" button (which starts a bunch of VBA code that
drives the process).  After that, a series of queries are run - sometimes
numbering in the hundreds.  A progress bar control and status text box tell
the user how far into the process he/she is.

The problem is that if the user hits "Go", and then opens a different window
on top of the active form (say, to check email), then goes back to the form,
the Access window and form no longer update their contents.  As long as the
user leaves that window on top, the display works fine.  As soon as another
window covers it up, that window no longer updates itself until the entire
process is finished - which can take up to half an hour.

Is there something in VBA that I can call to force the screen to update
periodically?  I tried Me.Repaint (with Me being the active form), and it
didn't work.

Thanks,

Eric
Klatuu - 25 Jul 2007 22:04 GMT
Since I don't know if your VBA is in a loop during the query process or if it
is inline, I will have to give a generic answer and you will have to figure
out where to put the code.
If it is a loop, I would put a DoEvents at the top of the loop; otherwise, I
would put a DoEvents occasionally in the code.
If that is not sufficient, follow it with Me.Repaint

Signature

Dave Hargis, Microsoft Access MVP

> I have a form that has a bunch of option boxes.  The user selects the options
> desired, and hits the "Go" button (which starts a bunch of VBA code that
[quoted text clipped - 16 lines]
>
> Eric
egun - 25 Jul 2007 23:20 GMT
Most of the queries are in loops, so I stuck the DoEvents wherever I updated
the value of the progress bar or status text.  Worked like a charm!

Thanks,

Eric

> Since I don't know if your VBA is in a loop during the query process or if it
> is inline, I will have to give a generic answer and you will have to figure
> out where to put the code.
> If it is a loop, I would put a DoEvents at the top of the loop; otherwise, I
> would put a DoEvents occasionally in the code.
> If that is not sufficient, follow it with Me.Repaint
Klatuu - 25 Jul 2007 23:22 GMT
Great.
Access is a real hog.  As long as he has something to do, it seems he
totally ignores Windows and anything else going on.
Signature

Dave Hargis, Microsoft Access MVP

> Most of the queries are in loops, so I stuck the DoEvents wherever I updated
> the value of the progress bar or status text.  Worked like a charm!
[quoted text clipped - 9 lines]
> > would put a DoEvents occasionally in the code.
> > If that is not sufficient, follow it with Me.Repaint
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.