Here is how I do it:
Code:
Private Sub ShowTabs()
With Me
.tbxSet = TestSet(.tbxLABNUM, "Soils & Aggregate")
.tab1.Visible = True
.tab2.Visible = True
.tab3.Visible = True
.tab4.Visible = True
.tab5.Visible = True
.tab6.Visible = True
.tbxLABNUM.SetFocus
If Not .tbxSet Like "*1*" Then
.tab1.Visible = False
.ctr1.SourceObject = ""
End If
If Not .tbxSet Like "*2*" Then
.tab2.Visible = False
.ctr2.SourceObject = ""
End If
If Not .tbxSet Like "*3*" Then
.tab3.Visible = False
.ctr3.SourceObject = ""
End If
If Not .tbxSet Like "*P*" Then
.tab4.Visible = False
.ctrProctor.SourceObject = ""
End If
If Not .tbxSet Like "*V*" Then
.tab5.Visible = False
.ctrVibratory.SourceObject = ""
Else
.tab2.Visible = False
End If
If Not .tbxSet Like "*H*" Then
.tab6.Visible = False
End If
If .tab1.Visible = True Then
.tab1.SetFocus
ElseIf .tab2.Visible = True Then
.tab2.SetFocus
ElseIf .tab3.Visible = True Then
.tab3.SetFocus
ElseIf .tab4.Visible = True Then
.tab4.SetFocus
ElseIf .tab5.Visible = True Then
.tab5.SetFocus
ElseIf .tab6.Visible = True Then
.tab6.SetFocus
End If
End With
End Sub