Forms not refreshing when navigating between them

Sketchin

Registered User.
Local time
Today, 00:35
Joined
Dec 20, 2011
Messages
583
I am having a frustrating issue that I can't nail down. I have a navigation control and if I choose a form, then choose a different form, I can still see part of the old form ontop of the most recently opened form. This also happens if I completely close all forms, I can still see part of the old form.

The circled part in this screenshot shows remnants of the old form still showing:
Painting issue 2.jpg



In this one, there aren't any forms actually opened right now, but you can still the the recently closed form:

Painting issue 1.jpg
 
I believe you mean it is not "repainting" the form. Refreshing is updating the data on the screen. You could try forcing a form.repaint, but you might be chasing the real issue. Try creating a new database and importing everything into that. If that fails you can try a database decompile
https://www.fmsinc.com/MicrosoftAccess/Performance/Decompile.asp. Obviously it should not be failing like that so there could be some kind of corruption in the form.
 
Make sure you have the latest video drivers, and also select a common default printer (e.g. MSFT Print to PDF).
 
Imported everything and the problem persists. I did notice that on my 4k monitor I don't see the same problem as on my 1080p monitor. I imagine its something in my graphics settings.
 
Imported everything and the problem persists. I did notice that on my 4k monitor I don't see the same problem as on my 1080p monitor. I imagine its something in my graphics settings.
Can you upload a copy to see if we see the same problem?
 
This also happens if I completely close all forms, I can still see part of the old form.

Just for clarification: Are you saying that with NO forms open, you can still see a form remnant where it used to be?

There is an "application.RefreshDatabaseWindow" method that might get rid of remnants. Probably you would want that to execute in the .Exit event of each form, though that is a guess.


Since it is an application object rather than a forms object, I'm not sure where you would best manipulate it.
 
That does not do a repaint of the "database screen". That is referring to this window
database window.png


As stated it is to refresh objects in that window that have been added, renamed, or removed via code.
Use the RefreshDatabaseWindow method to immediately reflect changes to objects in Microsoft Access in the Database window. For example, if you add a new form from Visual Basic and save it, you can use the RefreshDatabaseWindow method to display the name of the new form on the Forms tab of the Database window immediately after it has been saved.
 
Most MS Access control location/dimension properties (Left, Top, Width, Height) are typed as Integer and represent Twips.
• The max Integer is 2 ^ 15 -1, or 32767.
• There are 1440 per inch.
Doing the math, 32767 / 1440 = 22.755 inches. Lots of modern monitors are way bigger than that.

It's possible that this location/dimension issue is the cause of your screen issue. To test, try constrain the width of your nav control.
• Set the horizontal anchor to left.
• Set the width of the control to < 22.75"

Does the problem go away?
 
Access won't allow you to set the width greater than the (current) 22.75 inch limit in the property sheet though it is possible to do so (in twips) in code. Doing that does indeed lead to display glitches but I don't believe that is the issue here.
 
though it is possible to do so (in twips) in code.
Are you sure?

This causes an 'overflow' on my machine (because 2 ^ 15 exceeds Integer)....
Code:
    Me.Text0.Width = 2 ^ 15
This causes 'The control or subform control is too large for this location' (because the form isn't that big)
Code:
    Me.Text0.Width = 2 ^ 15 - 1

What I run into most is setting the Control.Left property of controls in response to a Form_Resize() event. I can't set Control.Left to anything greater than 32767 (about 22.75inch) and there's a guy in the office with a 40" monitor, so almost half his screen is inaccessible.
 
Sorry. My comment was badly worded. You were right to question that.
I meant you can attempt to do so in code but you will indeed get errors such as Overflow or this
1771490713128.png


Incidentally, one of my articles on automatic form resizing includes this screenshot of what happened when the code tries to scale up beyond the integer limit. In that case, once the limit was reached, Access tried to use the negative integer values creating a mess like that below!

The code was adjusted to prevent this happening by imposing the integer limit for scaling up

1771490895806.png


Anyway, I digress but thankfully the integer limit will very soon be a thing of the past.

In any case, this issue doesn't explain what is going on in the OP's original screenshot from post #1
 

Users who are viewing this thread

Back
Top Bottom