Slow form - events issue??

  • Thread starter darren via AccessMonster.com
  • Start date
D

darren via AccessMonster.com

Hi

I have a main form with a tab page with four subforms. Each subform has upto
40 fields of data. From these forms a number of related popup forms can be
opened.

At present with only a handful of records in it takes around 12 seconds to
open.
Auto name correct is off.
I have checked indexes.

Isolating the various subforms OnOpen and OnCurrent events brings the opening
time down to around 3 -4 secs.
Most of these events include a degree of setting defaults or requerying
certain controls/combo's to reflect changes. The some of these defaults reply
upon Lookups and for these I have used Allen Browne's ELookup suggestion.
These are having the effect of adding 3 secs per subform to the main forms
opening time.

I am considering trying to isolate these events to make them more specific to
when they are required. To be homest the OnCurrent events aren't really
required OnOpen but more likely on 'returning' to the forms from either other
tabs of popup forms.

Any thoughts or suggestions? Can't help thinking I'm missing something more
obvious, maybe my choice of events are not right.

Thanks in advance.
 
K

Klatuu

You are on the right track. Defer any non essential operations when you load
the form. Even though these operations will have to be done at some point,
the user's perception will be the systyem is running faster. Say, for
example, you have a sub form on the second tab. Don't put the record source
for that subform in in design view, assign it when the user clicks on the tab.

Another thing that will help is to move most of your form's code to a
standard module. The less code a form has in its module, the faster it will
load. The standard moduel doesn't load until it is referenced.

So, to summarize, don't do anything until you have to and keep your form as
light as possible. I went through this exercise with a form that 6 related
list boxes for report filtering. The original took 28 - 30 seconds to load.
I used the concepts described above and got it down to under 3 seconds.
Since the list boxes looked goofy sitting there empty. I made the height of
eac 0 and added a command button to load the row source and increase the
height.
 
D

darren via AccessMonster.com

FYI, have made significant improvements by rejigging the code slighty in the
events of returning to the main form and using the OnEnter event as an
alternative to the OnCurrent event.

As a future investment have also opted to opening the form empty and then
using a filter to select the necessary records as required.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top