Prevent Screen Updating

  • Thread starter Thread starter Deleted member 73419
  • Start date Start date
D

Deleted member 73419

Guest
Hi,
Due to a recent post, where I found out that I am unable to create controls at runtime on an Access form, I now have to create all my controls (100+ textboxes and labels) at design time and then change their position and/or size to hide them or show them at the correct time.

When the form is first opened, there is a moment where all the controls are visible shortly before the screen updates after my initial code has run and they all disappear, which is very annoying.

I have code which is fired in the form open event which iterates through the controls and determines whether they are a label or a textbox before resizing them to a size which is not visible - the code will eventually reposition the boxes etc but this is just the first step.

What can I do to prevent the the flickering of controls as they are enabled/disabled en mass?

Thanks
 
Hi. Have you tried setting all controls to Visible = No in Design View and then as the last action in your Open Event code to set Visible = True?
 
As well as setting all controls hidden initially, you can minimize flicker by using Application.Echo = False before any code to set controls visible.
Make sure you set Application.Echo=True after that code has finished so the display is updated

Not sure why you need to resize controls if you are going to hide them!
 
assuming you are opening the form with code (docmd.openform) you can set the window mode to hidden,


when the form opens your code can shuffle its controls around and as a last action display the form (me.visible=true)
 
I'm sure someone asked you what you were doing in the other thread so i don't want to belabor the point but Access is a RAD tool and RAD tools are based on bound forms and this form is obviously not bound so either it should be or you might want to think about a different toolset.

Please post a link to the earlier thread. Thanks
 
assuming you are opening the form with code (docmd.openform) you can set the window mode to hidden,


AcWindowMode enumeration (Access)

when the form opens your code can shuffle its controls around and as a last action display the form (me.visible=true)
Interesting. At present I am just opening the form by clicking on it as it is early days and not fully integrated enough for code but will give this a try when the time comes :)

As well as setting all controls hidden initially, you can minimize flicker by using Application.Echo = False before any code to set controls visible.
Make sure you set Application.Echo=True after that code has finished so the display is updated

Not sure why you need to resize controls if you are going to hide them!
Good question. Initially I tried to move the controls I didn't want to somewhere out of the way. I then thought I'd just make them so small I couldn't see them before just deciding on just hiding them. Strangely I never 'undid' the others when deciding to hide them!! :rolleyes:

Please post a link to the earlier thread. Thanks
Earlier post here
 
There is another possibility. Minimize the form, diddle with your controls, maximize the form. Nobody will notice the controls flickering. And it might look kind of neat for the "ready to go" form to maximize. But that's just me.
 

Users who are viewing this thread

Back
Top Bottom