Need help with Tabs

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
 
R

Rick Brandt

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()
 
B

BillA

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top