Solved

Access form displays slowly

Posted on 2011-02-16
13
296 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:RichNH
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 100 total points
ID: 34909685
1 second ?
So .. you consider that slow ?

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

mx
0
 
LVL 10

Assisted Solution

by:Michael Vasilevsky
Michael Vasilevsky earned 50 total points
ID: 34909912
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
 
LVL 1

Author Comment

by:RichNH
ID: 34910771
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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 12

Accepted Solution

by:
telyni19 earned 100 total points
ID: 34910773
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
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 100 total points
ID: 34910808
What code if any is running in the Form Load, Current and Activate events ?
0
 
LVL 1

Author Comment

by:RichNH
ID: 34911208
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
 
LVL 9

Assisted Solution

by:Armen Stein - Microsoft Access MVP since 2006
Armen Stein - Microsoft Access MVP since 2006 earned 50 total points
ID: 34911459
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
 
LVL 11

Assisted Solution

by:RgGray3
RgGray3 earned 50 total points
ID: 34912048
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
 
LVL 1

Author Comment

by:RichNH
ID: 34915648
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
 
LVL 1

Author Comment

by:RichNH
ID: 34915785
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
 
LVL 9
ID: 34917295
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
 
LVL 1

Author Closing Comment

by:RichNH
ID: 34922495
Thanks all.
0
 
LVL 75
ID: 34922505
You are welcome ...
mx
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

828 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