Interesting! Good idea. Thanks Bill.
When I have a tab control with subforms I dynamically load the Source Object (subform) using the tab control's Change event. A Select Case is good for that.
Private Sub TabCtl225_Change()
Dim strSQL As String
If gbolErrorTrapOff = False Then On Error GoTo err_PROC
'Save record before any child records are entered.
If Me.Dirty Then Me.Dirty = False
If Me.frmProjResources_sub.Form.Dirty Then Me.frmProjResources_sub.Form.Dirty = False
Select Case Me.TabCtl225
' Me.frmTotalHrs_ProjAct_ByRole_sub.SourceObject = "frmTotalHrs_ProjAct_ByRole_sub"
' Me.frmTotalHrs_ProjAct_ByRole_sub.LinkChildFields = "ProjectNum"
' Me.frmTotalHrs_ProjAct_ByRole_sub.LinkMasterFields = "ProjectNum"
' Me.frmRFS_DocStatus_sub.SourceObject = "frmRFS_DocStatus_sub"
' Me.frmRFS_DocStatus_sub.LinkChildFields = "ProjectNum"
' Me.frmRFS_DocStatus_sub.LinkMasterFields = "ProjectNum"
Case 5, 6
strSQL = "SELECT qryEmpInfo.FullName " _
& "FROM tblResources INNER JOIN qryEmpInfo ON tblResources.EmpID = qryEmpInfo.EmpID " _
& "WHERE ProjectNum = " & Me.ProjectNum _
& " AND tblResources.ActiveInProj <> 0 " _
& "ORDER BY FullName"
Me.frmActivities_sub.Controls("cboResourceID").RowSource = strSQL
Me.frmCriticalIssues_sub.Controls("cboOwner").RowSource = strSQL
On Error Resume Next
Dim strErrMsg As String
Dim lngIconBtn As Long
Select Case Err.Number
'Ignore "can't move to rec" error or "Save not available now".
gProcName = "TabCtl225_Change"
glngErrNum = Err.Number
gstrErrDescr = Err.Description
glngLineNum = Erl
If strErrMsg <> "" Then MsgBox strErrMsg, lngIconBtn, _
Hello Bill, I decompile quite regularly, and it doesn't seem to make any difference. The record sources can be simple tables too.
I've seen this slowdown when working with complex queries as RecordSources. Just to test, remove the RecordSources from the subs and move through the forms. If the slowness is gone then the problem lies in the fact that Access actually re-queries the subs with every focus change. Annoying but that's life.
One thing you might try is to decompile the database. Instructions here at FMS. Then compact. Then open your recordsource queries and make a little change. Save them. Undo your changes and save again. This forces Access to re-compile the queries.
I don't know if any of that will help you but I've used that technique in the past and it helped quite a bit.
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP
My nothing-to-do-with-Access blog
Does anyone including Microsoft understand how painstaking slow it is to move from subform to subform in design mode? Is it just me? Is it because I'm running it within Citrix?
I've worked these databases for 10 years and it was slow with 2002, slower with 2007, and even slower with 2010. It takes sometimes as long as 5-10 minutes for the control to get the focus and display the properties with which to work.
Programmer / Analyst
B/E Aerospace | Super First Class Environments
This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Posted by: Liz Ravenwood <Liz_Ravenwood@beaerospace.com>
|Reply via web post||•||Reply to sender||•||Reply to group||•||Start a New Topic||•||Messages in this topic (12)|