Results 1 to 2 of 2
2002-03-27, 18:12 #1
- Join Date
- Mar 2002
- Thanked 0 Times in 0 Posts
Slow Loading Form (Access 2000 SR1)
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 minutes to load vs. the 7 seconds it took only a few days ago.
2002-03-28, 04:31 #2
- Join Date
- Dec 2000
- Sacramento, California, USA
- Thanked 1 Time in 1 Post
Re: Slow Loading Form (Access 2000 SR1)
When a form loads, all the subforms load as well. The larger and more complex the recordset behind each of the subforms and the main form, the longer it will take to load. I'm not sure I understand you question about when the code loads.
If you decompile the project and then recompile it before compacting, it may indeed load faster. A2k can get itself into a partially compiled state that messes up performance in a major way. If the form was behaving and now isn't, a decompile may get rid of some of your gremlins.
Something else you might consider is not loading all those subforms at all. You can use the OnChange event of the tab control with a Select Case statement to set the appropriate SourceObject property of an unbound subform control, which will cause the subform to load *then* instead of when the form first opens. If you have a lot of subforms, that can be a major performance boost. Depending on how your form is designed, you might even be able to use a single subform control not bound to the tab control and make it appear to be different subforms as the various tabs are clicked. I've used both techniques extensively and they vastly improve performance of the form.Charlotte