Solved

Access form displays slowly

Posted on 2011-02-16
13
289 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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) 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
 
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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now