hii all
i have a main form with a tab , 9 sub forms
i notice navigation between records become slow , then i search for a solution , i find this code :
it works good before click on that tab , but when i change tab pages it return slow .
i have a main form with a tab , 9 sub forms
i notice navigation between records become slow , then i search for a solution , i find this code :
Code:
Private Sub ps_Change()
Select Case ps.Pages.Item(ps.Value).Name
Case "pg1"
' Where sfrm1 is the name of the subform on page 1
If Len(SubOrdersFrm.SourceObject) = 0 Then
SubOrdersFrm.SourceObject = "SubOrdersFrm"
' Me.LinkMasterFields = "OrderID;InsurCmpName"
SubOrdersFrm.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg2"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm1.SourceObject) = 0 Then
SubOrdersFrm1.SourceObject = "SubOrdersFrm1"
SubOrdersFrm1.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg3"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm2.SourceObject) = 0 Then
SubOrdersFrm2.SourceObject = "SubOrdersFrm2"
SubOrdersFrm2.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg4"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm3.SourceObject) = 0 Then
SubOrdersFrm3.SourceObject = "SubOrdersFrm3"
SubOrdersFrm3.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg5"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm4.SourceObject) = 0 Then
SubOrdersFrm4.SourceObject = "SubOrdersFrm4"
SubOrdersFrm4.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg6"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm5.SourceObject) = 0 Then
SubOrdersFrm5.SourceObject = "SubOrdersFrm5"
SubOrdersFrm5.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg7"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm6.SourceObject) = 0 Then
SubOrdersFrm6.SourceObject = "SubOrdersFrm6"
SubOrdersFrm6.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg8"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm7.SourceObject) = 0 Then
SubOrdersFrm7.SourceObject = "SubOrdersFrm7"
SubOrdersFrm7.LinkChildFields = "OrderNo;CmpIDDet"
End If
Case "pg9"
' Where sfrm2 is the name of the subform on page 2
If Len(SubOrdersFrm8.SourceObject) = 0 Then
SubOrdersFrm8.SourceObject = "SubOrdersFrm8"
SubOrdersFrm8.LinkChildFields = "OrderNo;CmpIDDet"
End If
' Repeat for each tab page
End Select
End Sub
it works good before click on that tab , but when i change tab pages it return slow .