Solved

How to clear a previous form from the screen?

Posted on 2006-10-29
12
212 Views
Last Modified: 2008-03-10
I have an Access system that has been around for a number of years.  It was designed when users used 800x600 screen resolution.  Now many users prefer higher resolutions and one user even has an LSD monitor that doesn't have 800x600.  I'm trying to clean things up so that everything looks ok in both lower and higher resolutions.  One problem with higher resolution is that if a form whose length is quite long is closed and a form with a shorter length is then opened, the bottom half of the previous long form continues to appear at the bottom of the screen.  I've used a Docmd.Close.  How do I get the screen cleared?  There's probably some syntax somewhere, but I've had no luck finding it.  (A2003)
0
Comment
Question by:WFBweb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 84
ID: 17829250
This shouldn't be happening. When a form closes, everything should be gone and if you're seeing "ghost" images of the old form, you may be experiencing the beginnings of corruption.

Make a copy of your db first, then perform a compact/repair (tools - Database utilities - Compact & Repair). See if this takes care of the problem.

You should also explicitly call the form in DoCmd.Close:

DoCmd.Close acForm, "YourFormName"

0
 
LVL 77

Expert Comment

by:peter57r
ID: 17829267
Hi WFBweb,
That sounds like a display driver issue, not an Access issue.

Pete
0
 

Author Comment

by:WFBweb
ID: 17829323
I do explicity call the form in Do.Cmd.Close.  And...I did the compact/repair.  The system is set up to automatically do this on closing too.

Re the driver issue......I'll go over there (a notforprofit I do volunteer work for) and double-check.  Possibly the prob is only on my own home pc where I do all the development work.  There aren't a lot of users over there who do not use 800x600 and I may not have noticed if the prob did not occur for them.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 26

Expert Comment

by:dannywareham
ID: 17829440
>>That sounds like a display driver issue
I'd hasten to agree.

You can also get this problem intermittently if your CPU usage is particularly high.
The result is that the previous application screen stays on screen and looks like the new screen has sort of cut out part of it.

0
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 125 total points
ID: 17829541
You don't have any code that prevents screen updates do you?
Possibly Echo or, since you're closing the form, the Painting property of the form - so perhaps
Application.Echo = False
Or
Docmd.Echo False
Or
Me.Painting = False

Before calling your form close - perhaps insert a line
Docmd.Echo True
or
Me.Painting = True

Just to be sure on that score?
0
 

Author Comment

by:WFBweb
ID: 17830202
The same situation does occur over at the notforprofit.  I even upped the resolution of one of the 800x600 pc's and it had same prob.

Re Echo.  I did not realize that echo false stopped the actual updating of screens.  I have presumed that it merely did not show any ongoing changes to the user until the echo true was applied.  I frequently use it to stop minor movement/jumping reflected in closing and opening forms when it is not used.

To make the situation even more complex, I have a couple of 'short' forms that are, except for the data, exactly like the ones that show part of the previous form below them.  They do not show it.  They are all treated the same and basically have the same properties.....at least my sleuthing so far indicates that they do.

I'll do some experimenting with the echo.

0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17830237
If you use Echo at all (let alone a lot) it's imperative that you have good error handling - so that it is *never* allowed to persist.
Since you do use it - I'd certainly suspect this is the cause, however plugging in a switch of it back on in the form closing event would merely be patching over the cracks.
You need to determine where in your code it is being used and not set back on again.
And make sure that this never happens.
0
 

Author Comment

by:WFBweb
ID: 17831714
I haven't read the ten commandments in many years.....forgot all about the one that said 'thou shalt not echo'.
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17831877
Apparently it's OK - as long as you're not a duck!
(I read somewhere once that a duck's quack doesn't echo).

And of course you're free to use Echo in your applications.
Just as long as you're sooo careful to turn it back on again. :-)
0
 

Author Comment

by:WFBweb
ID: 17832995
I still haven't run down a culprit echo, but will keep at it.
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17833005
Does switching echo back on before closing the form make it behave though?
0
 

Author Comment

by:WFBweb
ID: 17833911
These forms are unbound main forms with at least one subform.  The main forms had echo on logic, but the forms that did not work had OrderBy code in the subform with no echo on.  The forms that worked properly had the OrderBy code for the subforms in the main form where the echo on was applied.  I moved the OrderBy logic of all the subforms to the main forms and everything works fine.  I believe that subforms are processed before mainforms so the echo off was in place causing the problem.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linking Child/Parent fields between 2 subforms 15 61
Conditional Format if Between Dates 9 45
Access Query function 4 51
Unidentified Function 2 29
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question