Previous Thread

8/11/2006 7:40:50 AM    question on Tab Strip (OCX) and sub form
Hi, 
 
I have build a universal search form having ProvinceID (combo) DistrictID 
 
(combo) and CommuneID (combo). These combos are cascasded. I have a Tabstrip 
 
(OCX) and a subform. I have two tabs, Project and Contact. The form is 
 
almost working except that It ask for a parameter (linkchild & master 
 
field). Once I click OK, it display correct information. Is there a way to 
 
stop the form to ask question? 
 
Private Sub TabStrip_Click() 
 
On Error GoTo Err_TabStrip_Click 
 
'Me.Focus.SetFocus 
 
Me.TabStrip.MousePointer = ccHourglass 
 
Select Case Me!TabStrip.SelectedItem.Index 
 
Case 1  ' Tab one selected. 
 
If Not Me![SubForm].SourceObject = "frmSearchProjectByCommunes" Then 
 
Me![SubForm].SourceObject = "frmSearchProjectByCommunes" 
 
Me.SubForm.LinkChildFields = "P_CommuneID" 
 
Me.SubForm.LinkMasterFields = "CommuneID" 
 
End If 
 
Case 2  ' Tab two selected. 
 
If Not Me![SubForm].SourceObject = "frmContactGeneral" Then 
 
Me![SubForm].SourceObject = "frmContactGeneral" 
 
Me.SubForm.LinkChildFields = "Co_CommuneID" 
 
Me.SubForm.LinkMasterFields = "CommuneID" 
 
End If 
 
End Select 
 
Me.TabStrip.MousePointer = ccDefault 
 
Exit_TabStrip_Click: 
 
Exit Sub 
 
Err_TabStrip_Click: 
 
MsgBox Err.Description 
 
Me.TabStrip.MousePointer = ccDefault 
 
Resume Exit_TabStrip_Click 
 
End Sub