A
Amit
Access 2K, Win XP
------------------
Hi,
I'm having problem making a tab page invisible on a form
when I move to a new record from an existing record.
My form has a tab which has 2 pages, each having a
different subform. Based on the value selected in a combo-
box on the main form, I make the appropriate page visible
and the other invisible.
It's working fine, except when I move to a new record from
an existing record. In that instance, the tab page from
the previous record is visible. I'd like both pages of the
tab to be invisible when I move to a new record.
Here's the code:
======================================
Private Sub Form_Current()
If Me.NewRecord = True And IsNull(Me.cboPayeeType) Then
Me.TabCtl10.Pages(0).Visible = False
Me.TabCtl10.Pages(1).Visible = False
End If
If Me.cboPayeeType = 1 Then
Me.TabCtl10.Pages(0).Visible = True
Me.TabCtl10.Pages(1).Visible = False
End If
If Me.cboPayeeType = 2 Then
Me.TabCtl10.Pages(0).Visible = False
Me.TabCtl10.Pages(1).Visible = True
End If
=========================================
Private Sub cboPayeeType_AfterUpdate()
If Me.cboPayeeType = 1 Then
Me.TabCtl10.Pages(0).Visible = True
Me.TabCtl10.Pages(1).Visible = False
End If
If Me.cboPayeeType = 2 Then
Me.TabCtl10.Pages(0).Visible = False
Me.TabCtl10.Pages(1).Visible = True
End If
End Sub
=========================================
Any help will be appreciated.
Thanks!
-Amit
------------------
Hi,
I'm having problem making a tab page invisible on a form
when I move to a new record from an existing record.
My form has a tab which has 2 pages, each having a
different subform. Based on the value selected in a combo-
box on the main form, I make the appropriate page visible
and the other invisible.
It's working fine, except when I move to a new record from
an existing record. In that instance, the tab page from
the previous record is visible. I'd like both pages of the
tab to be invisible when I move to a new record.
Here's the code:
======================================
Private Sub Form_Current()
If Me.NewRecord = True And IsNull(Me.cboPayeeType) Then
Me.TabCtl10.Pages(0).Visible = False
Me.TabCtl10.Pages(1).Visible = False
End If
If Me.cboPayeeType = 1 Then
Me.TabCtl10.Pages(0).Visible = True
Me.TabCtl10.Pages(1).Visible = False
End If
If Me.cboPayeeType = 2 Then
Me.TabCtl10.Pages(0).Visible = False
Me.TabCtl10.Pages(1).Visible = True
End If
=========================================
Private Sub cboPayeeType_AfterUpdate()
If Me.cboPayeeType = 1 Then
Me.TabCtl10.Pages(0).Visible = True
Me.TabCtl10.Pages(1).Visible = False
End If
If Me.cboPayeeType = 2 Then
Me.TabCtl10.Pages(0).Visible = False
Me.TabCtl10.Pages(1).Visible = True
End If
End Sub
=========================================
Any help will be appreciated.
Thanks!
-Amit