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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get better performance by changing the way subforms are loaded 2

Status
Not open for further replies.

DomDom3

Programmer
Jan 11, 2006
59
GB
Hi there,

I'd like to improve the loading time of a form by limiting the number of subforms that need to be loaded.

The Form has 7 subforms, all have different queries as control sources, but not all have to be seen at the same time or immedieately, but I'ms tuck on the best way to do this.

I guess I can make some load invisible then use code to make them visible but I'm unsure how much better this would be.

An alternative would be to use a control to open the subform when clicked, but I'm unsure what vba I would need to add a subform.

Dooes anyone have any advice on this?

Thanks

Dom


 
As far as I know, you cannot add controls except in design view, so you will need invisible subforms. I think that if you only set the record source when you make the form visible, you will achieve some improvement in the time it takes for the form to load.
 
Sometimes I will put subforms on different tabs, then only set the recordsources when a tab is clicked. Seems to help performance, because often only concerned with one or two of the subforms.
 
How are ya DomDom3 . . .

Wether loading the [blue]RecordSource[/blue] when the form is made visible or switching tabs, [blue]you don't want the RecordSource reloading everytime[/blue] you flip back & forth. So with a [blue]default recordsource of nothing ("")[/blue], in the [blue]Load[/blue] event of of the forms you would have something like:
Code:
[blue]   If Me.RecordSource = "" then
      Me.RecordSource = "YourRecordSourceString"
   End If[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top