Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access form displays slowly

Posted on 2011-02-16
13
Medium Priority
?
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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 200 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 12

Accepted Solution

by:
telyni19 earned 400 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 400 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 200 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 200 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

730 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