Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Fri Nov 9 11:56:16 CST 2007
Unfortunately, in my case. MOST of the bound fields are not in subforms but scattered throughout the multiple tabs. I think we're going for the one record or very few records approach by modifying the Record Source on the fly rather than using form filters as it is now. Hopefully that reduces what's coming over the wire. Brings up another question - if a filter is set on Open, do all the records come over anyway and access just makes the filtered subset available to the form? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, November 09, 2007 9:35 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] JIT Forms I'm not suggesting binding subforms until they're loaded, John. I don't do that either. I'm saying you don't need a full dataset behind the parent form if all your subforms are going to be bound WHEN THEY'RE LOADED. You can get by with a snapshot of the key fields at most. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 09, 2007 8:10 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] JIT Forms Charlotte, I don't understand what you are saying here. What problem are you solving? Binding the subforms before they are actually viewed causes the form to slow down as it loads all of the subforms and their respective controls, even though the user may in fact never visit the subforms (that tab). So leave the subform controls with no source object (form name) until the tab is clicked on (JIT subforms). Now in the query for the main form just specify a filter for the PKID of the parent object, claimID if the form displays claims, CustomerID if the form displays customers etc. By feeding the query one specific PKID it will pull only that one record for the main form. The subforms on the tabs do not load until the tab is clicked. That is about as fast as you are going to get to actually load the form and its data. So what are you saying? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, November 09, 2007 10:45 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] JIT Forms Rocky, If you bind just subforms, not the main form, you solve that problem. Basically, all you need in the main form is the fields to link to, although, they don't have to be in bound controls, so you could populate them from code for each tab. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Thursday, November 08, 2007 8:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] JIT Forms I'm good to go. Thanks. However, converting all the combos and subforms to JIT still did not yield an acceptable opening time. The reocrdsource for the main form is retrieving all the records and the navigation buttons are at the bottom of the form. I have asked the client if users would really use those buttons to move from one record to another. I'm thinking not. In which case retrieving one record might be the hot ticket. Thanks and regards, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, November 08, 2007 7:36 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] JIT Forms And that is really about all there is to it. Except... You need to be careful about the Link Master / child properties. I leave them set and just change the source object IIRC. Beyond that you need to make the decision whether to leave the subforms bound or unbind them as the user clicks off the tab. And no I don't do anything about loading the combos specifically. Since only the combos on the specific subforms loading are at issue, this will not tend to be a problem. Since everyone else jumped in with info I will let you ask if you need more than that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Thursday, November 08, 2007 8:19 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] JIT Forms Aha. That's what I was looking for. Change event. Too bad there isn't a GotFocus or Activate event for each page. But this will work. I can do a Select Case on the page and load the controls for that page in the case for each tab. That will work! Thanks Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren D Sent: Thursday, November 08, 2007 3:37 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] JIT Forms Hi Rocky Not so sure about JC's cool JIT logic But there is an OnChange event for Tabs - Way cool very powerful and easy to manipulate See below for some Code snips below I am using for a 10 Tab Form Now it is a snip so some of it may not work correctly etc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Private Sub tabMain_Change() On Err GoTo Err_tabMain_Change Dim intClientID As Integer intClientID = Me.tabMain Dim tbc As Control Dim pg As Page Dim ctl As Control Dim db As DAO.Database Dim selSQL As String Dim rs As DAO.Recordset Set tbc = Me!tabMain Set pg = tbc.Pages(tbc.Value) 'Current page Set db = CurrentDb selSQL = "SELECT tblClients.ClientID, tblClients.ClientName, tblClients.DatabaseName, tblClients.ClientAbbrev, tblClients.IsCurrent, tblClients.IsNowDeleted FROM tblClients WHERE (((tblClients.IsCurrent)=-1) AND ((tblClients.IsNowDeleted) Is Null Or (tblClients.IsNowDeleted)=0));" Set rs = db.OpenRecordset(selSQL) 'reset things to true or false if true may exist for more thant 1 tab If pg.Name = "pgOptions" Then ' Option Page - Don't show everything for the clients - Show the setup options only Forms!xfrmBeast!subfrmOptions.SourceObject = "sub_frmBeastOptions" Forms!xfrmBeast!subfrmLocalOptions.SourceObject = "sub_frmLocalOptions" Me.subfrmMain.Visible = False Me.tabOptions.Visible = True Me.subfrmNotes.Visible = False Me.subfrmContacts.Visible = False Me.tabSupport.Visible = False 'Determine what controls get seen or used For Each ctl In Me.Controls If ctl.Tag <> "" Then ctl.Enabled = False End If Next ElseIf Me("pg" & Me.tabMain).Caption = "Active" Then ElseIf Me("pg" & Me.tabMain).Caption = "SomeText" Then Me.cmdBFM.Enabled = False Else For Each ctl In Me.Controls If ctl.Tag <> "" Then ctl.Enabled = True End If Next Me.tabOptions.Visible = False End If Me.subfrmMain.Requery Me.subfrmNotes.Requery Me.subfrmContacts.Requery Me.txtClientID = Forms!xfrmBeast.tabMain txtInvoiceSearch = "" txtAccountNo = "" If intClientID = 0 Then Me.subfrmContacts.Form.lblAdviceContacts.Caption = "General Contacts" Me.subfrmNotes.Form.lblAdviceNotes.Caption = "General Notes" Me.lblMain.Caption = "Options and Settings" txtInvoiceSearch.Enabled = False txtAccountNo.Enabled = False ElseIf intClientID = 1 Then Me.subfrmContacts.Form.lblAdviceContacts.Caption = "Active Contacts" Me.subfrmNotes.Form.lblAdviceNotes.Caption = "Active Info" Me.lblMain.Caption = "Details about...us" txtInvoiceSearch.Enabled = False txtAccountNo.Enabled = False ElseIf intClientID = 2 Then Me.subfrmContacts.Form.lblAdviceContacts.Caption = "Contacts for Client: " & Me("pg" & intClientID).Caption Me.subfrmNotes.Form.lblAdviceNotes.Caption = "Notes For Client: " & Me("pg" & intClientID).Caption Me.lblMain.Caption = "Bureau Details for: " & Me("pg" & intClientID).Caption txtInvoiceSearch.Enabled = True txtAccountNo.Enabled = True ElseIf intClientID > 1 Then Me.subfrmContacts.Form.lblAdviceContacts.Caption = "Contacts for Client: " & Me("pg" & intClientID).Caption Me.subfrmNotes.Form.lblAdviceNotes.Caption = "Notes For Client: " & Me("pg" & intClientID).Caption Me.lblMain.Caption = "Bureau Details for: " & Me("pg" & intClientID).Caption txtInvoiceSearch.Enabled = True txtAccountNo.Enabled = True End If rs.Close db.Close Set rs = Nothing Set db = Nothing Exit_tabMain_Change: Exit Sub Err_tabMain_Change: MsgBox Err.Number & " " & Err.Description, vbCritical, "Error in tbMain Change" Resume Exit_tabMain_Change End Sub Many thanks Have a great day Darren ----------------- T: 1300 301 731 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Friday, 9 November 2007 9:32 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] JIT Forms JC: I have a form with about 16 tabs, a bunch of combo boxes, and a bunch of sub-forms. It will not surprise you to learn that it is taking an unacceptably long time to open - 60 seconds on a smallish database over a wireless connection to my laptop (trying to simulate a slow server). I remember something about a form like this that you had and, I believe, loading the combo boxes and sub forms only when a tab got the focus? The combo boxes are bound so I can't wait to put in the row source until they're clicked. But I could load the row source when the tab was activated - store the row source in the tag and load it if it's not there. But there's no activate or got focus event for a tab. There is a mouse move event but I'm not sure that will do to trigger loading of the Row Source and the sub-forms. How did you solve the problem? Regards, Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.24/1117 - Release Date: 11/7/2007 10:52 PM -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.26/1119 - Release Date: 11/8/2007 5:55 PM -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.26/1119 - Release Date: 11/8/2007 5:55 PM