Access form displays slowly

I have an Access 2007 form which, when it opens, the controls display one by one rather than showing all at once.  It is a bit of a distraction and I was hoping to come up with a method of getting the form to appear without the popping in of the various controls on the form.  

What I tried to do was set the form's visible property to False at the beginning of the LOAD event and then set it back to True when the form was ready.  The problem is that no matter which event (Current, Activate, Got Focus for the 1st control) I put the me.visible = true statement in the form still displays with a noticable lag in the displaying of controls on the screen.

The lag in time of when the form first appears to when the last control displays is about 1+ second in length.  I know that this doesn't seem long but I would rather have the form display with all controls already displayed on it.

Does anyone have any other ideas or do I have the right idea but am putting the me.visible = true statement in the wrong spot?

Rich
LVL 1
RichNHAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
telyni19Connect With a Mentor Commented:
Even with the front-end local, the controls can appear slowly on a form if there are a lot of them and if they are bound to data being transferred over a network. I have a database that's based on a fairly slow network, and it might take three seconds to display the most complex form fully. Setting the Visible quantity might help if you're doing significant setup or calculations while loading, but the transition from invisible to visible itself requires Access to do some processing, so my database doesn't noticeably benefit from that trick either.

Another option might be to use Application.Echo(False) and Application.Echo(True) to disable screen updating until the form is loaded, but again, repainting the screen may simply take a second or two to perform for a complex form.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
1 second ?
So .. you consider that slow ?

What code if any is running in the Form Load, Current and Activate events ?

mx
0
 
Michael VasilevskyConnect With a Mentor Solutions ArchitectCommented:
How many controls? Is it over a network? If so, you may want to split the db and install the front-end locally on each machine.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
RichNHAuthor Commented:
I have split the DB into FE/BE and I have removed all the RowSource values from the combo controls and put code into the Form_Current event which sets the recordsource properties if they are = "" and which are executed only when the Form_Load event has been exited.  

The effect I'm looking for is something similar to this:
If I have a displayed form and make that form invisible, then later I make the form visible the form displays with no apparent time spent building it control by control.  It almost seems instantaneous.  I was looking for that effect.  I am executing it over the network, but the not visible/visible test works fine even if it is over the network so the network isn't entering into the picture.  I was trying to get that effect automatically when the form first displays.  Unfortunately no matter which event I put the me.visible = true code in, I still see the form being built.  

It's almost as if the form isn't really built until it is made visible for the first time.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
What code if any is running in the Form Load, Current and Activate events ?
0
 
RichNHAuthor Commented:
There's a bunch of code in the form load and current events.  

When I first enter into Form_Load I set the form visible property = false  (has the form even loaded yet when you enter this event's module?).  I also set a public boolean switch to true to indicate that the I am in the form load event.  When I exit the form load event I set this switch to false.  I test this switch at the top of the form current event and if its true I exit the form current event without executing any code.  So in effect, while form load is executing the form current event doesn't execute any code.

[after some more testing...]

It would appear that the me.visible property doesn't have any effect until after the form is made visible for the first time.  Since it is the speed at which the form is being painted that I have issue with, I'm starting to think that there's not much I can do about the speed at which the form is painted.  I was hoping that I could paint the form while it was invisible, but that doesn't appear to be an option here.  Time to sleep on it I think.
0
 
Armen Stein - Microsoft Access MVP since 2006Connect With a Mentor PresidentCommented:
Have you tried opening the form Hidden to begin with during your OpenForm?  (WindowMode:=acHidden)

You can then try making it visible again during a later time, like at the end of the code in the Load event.

But it seems like you're working very hard to solve a very small problem - a 1 second form load time.  It's easier to swim downstream than upstream.
0
 
RgGray3Connect With a Mentor Commented:
ArmenStein & telyni19 are both on the right path...
Either open Hidden or Turn Echo off...  both are valid solutions...
but I think the best event to use is the OnTimer Event...

Your problem seems not to be the real speed but the percieved speed of the program.
0
 
RichNHAuthor Commented:
Definitely perceived speed.  But in politcs, perception is reality.  I'm unfamiliar with both open hidden and echo methods.  Let me look into them.
0
 
RichNHAuthor Commented:
After looking into those options and considering your comments I'm concluding that you are all right, this is not worth the effort.  But I learned something.  :-)

Thank you all for helping me.  I am at a loss as to how to assign points.  My gut feel, because everyone had suggestions and tried to help is to break up the points based on the following portions:

DataBaseMX      2
Mvasilevsky       1
Telynil9               2
ArmenStein         1
RqGrey3             1

Are there any objections to this?
0
 
Armen Stein - Microsoft Access MVP since 2006PresidentCommented:
Hey, if you concluded that it's not worth the effort, then I should get ALL the points!  I advised you to swim downstream.  <very big smile>

Seriously, just assign points based on the value you got, it's no big deal.

Cheers,
Armen
0
 
RichNHAuthor Commented:
Thanks all.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
You are welcome ...
mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.