Hide Access Screen Activity
Problem
You can use a form’s Painting property to disable updates to that form and the Application.Echo method to disable updates to the Access window, but some activities still seem to show through or cause flashing on the screen. Is there any way to really hide screen activity?
Solution
Sometimes you need more control over screen repainting than you get with either Application.Echo or Form.Painting. You’ve already exhausted the options that Access provides for controlling the screen display. But there is one more alternative: Windows itself, through calls to the Windows API, allows you to disable screen updates for a window and all its children. Because Access makes it easy to retrieve the handle for the main Access window, you can disable all updates to that (or any other) window. This solution demonstrates a method of truly shutting off screen updates to the Access window. (Before you try it, however, be sure to read the cautions in Section 4.4.3.)
Load and run frmLockScreen (Figure 4-9) from
04-04.MDB. This sample form simply opens three
reports in design mode and then closes them. The form includes a
checkbox that allows you to run the test with screen updates enabled
or disabled. Try it both ways; you should see a clear difference
between the two ways of running the test. With the checkbox set, the
underlying code disables screen updates, so you shouldn’t see
the reports’ icons pop up. Without the checkbox set, you will
see the icons.
Figure 4-9. The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access