Need help with Tabs

  • Thread starter Thread starter BillA
  • Start date Start date
B

BillA

I have a form that uses a combo box to control the visibility of two tabs and
changes the ‘enabled’ for a third form. This is my code I use to control the
tabs:
Private Sub cboStatus_AfterUpdate()
Select Case Me.cboStatus
Case 2
Me.TabPages.Pages(2).Visible = True
Me.TabPages.Pages(3).Visible = True
Me.TabPages.Pages(1).Enabled = False
Case Else
Me.TabPages.Pages(2).Visible = False
Me.TabPages.Pages(3).Visible = False
Me.TabPages.Pages(1).Enabled = True
End Select
End Sub
I would like to have this same functionality (tabs are visible or hide and
change enable) when the new record form loads and when I move from one record
to the next; all based upon the record combo box value, but I haven’t been
able to find the correct syntax.

Appreciate any advice/guidance.
Thank you,
Bill
 
BillA said:
I have a form that uses a combo box to control the visibility of two
tabs and changes the 'enabled' for a third form. This is my code I
use to control the tabs:
Private Sub cboStatus_AfterUpdate()
Select Case Me.cboStatus
Case 2
Me.TabPages.Pages(2).Visible = True
Me.TabPages.Pages(3).Visible = True
Me.TabPages.Pages(1).Enabled = False
Case Else
Me.TabPages.Pages(2).Visible = False
Me.TabPages.Pages(3).Visible = False
Me.TabPages.Pages(1).Enabled = True
End Select
End Sub
I would like to have this same functionality (tabs are visible or
hide and change enable) when the new record form loads and when I
move from one record to the next; all based upon the record combo box
value, but I haven't been able to find the correct syntax.

Appreciate any advice/guidance.
Thank you,
Bill

In the Current event of the form repeat the same code or just call the
existing procedure.

Call cboStatus_AfterUpdate()
 
Thank you Rick,
It worked perfectly... I already had a current event and I was going at it
all wrong by trying to create an additional current event.
I didn't realize I could have multiple events within the same sub proceedure.

Amazingly simple answer that I hadn't considered.

Take care,
Bill
 
Back
Top