John Colby
jcolby at colbyconsulting.com
Thu Oct 2 18:48:29 CDT 2003
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 John W. Colby www.colbyconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of David Fenton Sent: Thursday, October 02, 2003 6:57 PM To: accessd at databaseadvisors.com Subject: [AccessD] Just in Time (off shoot of Can't open any more databases) Charlotte and William, you have both got me thinking! 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). When the user clicks on each tab I assign an SQL string to the recordsource of the subforms under that tabb, the form opens the record source and each child subform does its master/child filtering. All is well, but it IS slow. Is this the accepted way to do it? Because if you are saying it should be faster, then Id like to do it properly so that it IS faster on my application. I must be doing something wrong. A sample of my code: Case 6 ' Transfers IN Simple procedure to remove recordsources from forms hidden when user leaves previous tab ClearRecordSource (Forms!frmEN_AddEnrolmentFees!sfrmTransferOUT.Form) ClearRecordSource (Forms!frmEN_AddEnrolmentFees!sfrmTransferDetailsOUT.Form) ClearRecordSource (Forms!frmEN_AddEnrolmentFees!sfrmTransferDetailsIN.Form) Set up the recordsource strings for the three visible subforms (master and two children) Dim rsIN As String Master subform recordsource Dim rsINfromDetails As String child 1 subform recordsource Dim rsINtoDetails As String child 2 subform recordsource Assign the strings to the variables rsIN = "SELECT tbl_Transfer.Trf_ID AS TransferID, tbl_Transfer.Trf_Num AS TrfNumber, tbl_Transfer.Trf_Printed AS Printed, tbl_Transfer.Trf_Date AS DateIssued, tbl_Transfer.Trf_Description, tbl_Transfer.Trf_Enrol_ID_out AS fromEnrolID, tbl_Transfer.Trf_Enrol_ID_in AS toEnrolID, tbl_Transfer.Trf_Amount AS AmtTransferred FROM tbl_Transfer;" rsINfromDetails = "qryEN_FI_TransferDetailsOUT" rsINtoDetails = "qryEN_FI_TransferDetailsIN" Assign recordsources to the three subforms under tab user just clicked on mainTrfINfrm.RecordSource = rsIN Where mainTrfINform is a form object previously set detailTrfINfrom.RecordSource = rsINfromDetails detailTrfINto.RecordSource = rsINtoDetails etc . Any ideas? Cheers David Ô¿Ô¬ Ext 0751 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20031002/97ed4ba1/attachment-0001.html>