David Fenton
dfe at nudgeeinternational.com
Sun Oct 5 20:11:57 CDT 2003
Hello Charlotte and John, You have both solved my hassles with the Can't load anymore databases. I implemented JIT properly this time and it seems to have fixed the problem. When the user clicks on a tab, the unbound subform takes about a second or so to refresh itself after my code assigns the SourceObject, but the users will have to live with that. John, I like your idea of unloading (when the user clicks on a different tab) the SourceObject from the subforms using a global sysvar and may also implement that in my application. I am grateful for you help. Cheers David Ô¿Ô¬ Brisbane Australia Your messages: Message: 4 Date: Thu, 2 Oct 2003 16:02:12 -0700 From: "Charlotte Foust" <cfoust at infostatsystems.com> Subject: RE: [AccessD] Just in Time (off shoot of Can't open any more databases) No, the fast way is to use an unbound subform control and set its sourceobject in code to a particular subform, not a bound subform control with a change to the recordsource. If you use SQL strings like that, it means that the SELECT statements are not optimized in Access 2000 and 2002 and can lead to significant delays in loading the form. Charlotte Foust Message: 5 Date: Thu, 2 Oct 2003 19:48:29 -0400 From: "John Colby" <jcolby at colbyconsulting.com> Subject: RE: [AccessD] Just in Time (off shoot of Can't open any more databases) To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Message-ID: <DCEFJAOENMNENLAAOFGPKEFOFDAA.jcolby at colbyconsulting.com> Content-Type: text/plain; charset="iso-8859-1" Just in Time (off shoot of Can't open any more databases)>Yes I do use the Master/Child filter, but when the form is first loaded all of its subforms sit there blank behind their appropriate tabs (each with no recordsource). I think you are not using JIT at all. JIT means that the SOURCE OBJECT property of the subform control on a tab is empty. IOW, if you could see the tab, the entire subform would not be there at all, you couldn't see the text boxes on the subform etc. It sounds like you are saying that you have the subforms loaded, but then load the RECORDSOURCE (DATA) to the subform? I don't mess with the recordsource of the subform at all under normal circumstances. Each subform has a recordsource that is usually a saved query. The recoursource property always references the query - and is saved that way, i.e. if you open the subform in design view you would see the query name or SQL statement. I assign the form name to the SOURCE OBJECT property. What this does is actually LOAD the subform into the tab at the instant that the source object property is set. Since the subform has a recordsource property, it loads its data when the form loads. For some reason I then have to read out the Link child and master field properties and write them right back in. I don't know what you consider painfully slow of course but in general a subform takes 1/2 second to one second to load. It can be more of course depending on how many combos and lists are on the subform - they also have to load their data. Of course if the subforms have tabs (Yep, I've done that) then they are also JIT to avoid having to load all of those subforms at one time. The entire point of JIT subforms is to reduce load time of the parent form, since any tab the user never clicks on never loads the subforms on that tab. It can make a world of difference. Bottom line, if the user is going to see the subform, then it has to load and they have to wait for that load. The point is that in forms where they only NORMALLY use a few of many tabs, the subforms on the other tabs never load so the user never has to wait for those subforms to load. I actually use an application global sysvar to decide whether to unload the subforms once loaded (when the user clicks to another tab). Sometimes it makes sense, others it doesn't. I then use form specific sysvars to over-ride the global sysvar if I need a specific form to buck the global trend. IOW I can decide that in general, the subforms WILL unload when the user clicks on a different tab, but for frmXXX the subforms will NOT unload. Application SysVars are a real neat trick for customizing an app in this manner. John W. Colby www.colbyconsulting.com ************