Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Slow loading Access form

Status
Not open for further replies.

villstep

Programmer
Aug 24, 2001
3
US
In Access, when a form is loading, the code behind the form also loads, but do all forms somehow referenced by code in that form get loaded as well -- even if they are on a page of a tab control that does not have the focus?

Is there a difference between when the code behind a form loads and when code in a module loads?

If we compile the project will the forms load fster?

Suddenly a form in my database takes 2 minuets to load vs the 7 seconds it took only a few days ago.
 
Not sure if this will help, but I have a form with some top level data on it, and then a tab control with about 6 pages. Some of the tab-pages have 'direct' data on them, some have subforms on them.

Access loads all the subforms and checks their controls and data sources before it even does the main form. Queries are executed, comboeaux filled up, etc etc.

Is there a difference between when the code behind a form loads and when code in a module loads?

Module code is 'loaded' on database activation. Form code is loaded when that FORM is opened.

If we compile the project will the forms load fster?

Perhaps just barely imperceptably. Your form delay is probably more related to DATA I/O accesses than form loading, and compiling probably won't help that much.

Suddenly a form in my database takes 2 minuets to load vs the 7 seconds it took only a few days ago.

That seems a bit much. Somewhere, some control on that form is what's causing the delay. Or someother arcane Access bug got in there.

Try exporting the form to a blank db, deleting the original ,and them importing it back in. Sometimes a little shimmy here and a shake there seem to do wonders.






Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
 
Without fully knowing what changes you have made over past few days, it's hard to give you specific details.

Yes, a tab control is just that, a control. Everything in every tab control will be loaded when the form is loaded.

Also, the code in a module loads when the Access database is started, and the code behind a form is only accessed when the form is opened. If you have code that is accessed frequently by multiple forms, then it's best to put it in a code module. You have to weigh out were you want the wait on loading code is to be...when opening the form, or opening the database.

But a few more things you should be aware of...
-Use bitmaps sparingly on forms.
-Close other forms that aren't being used.
-A form without a form module loads more quickly. If a form or controls on the form don't use event procedures, the form doesn't require a form module.
-If the underlying record source includes many records, and if you open a form with all records showing, Access has to read in each record.
-Use the Performance Analyzer to analyze specific forms in your database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top