Access Tab Control - Show Caption by Tab

I have two tabs, one for Expenses the other for Budget Entry.  Unable to get the Caption for the form to read based on each tab - have tried On Change() and on Click.  

Help???
GR82BBlondieAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
GR82BBlondieConnect With a Mentor Author Commented:
Chose not to pursue this.  

Thank you.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
I highly recommend against this.
The form caption should describe the form, not the tab of a tab control that is currently active.

If you really wanted to do this, it would be the tab control's Click event.
Keep in mind that every time this is done it requires a form repaint, and that may be slow if your form has a lot of objects in it.

Private Sub YourTabControl.Click

Select Case YourTabControl.Value
   Case 1
       Me.Caption = "foo"
   Case 2
       Me.Caption = "bar"
End Select

Me.Repaint

End Sub
0
 
GR82BBlondieAuthor Commented:
Thank you for the response.  I understand not recommending it but it's being requested from higher up the ladder.  :)

Unfortunately this did not work.  

Private Sub TabCtl.Click (recieve and error message - Compile Error Expected: end of statement.)  Is this suppose to be Private Sub TabCtl_Click()  

Another quesiton:  Select Case TabCtl.Value - does that mean the value of the page?  I tried TabCtl.Value(0) and TabCtl.(0) but neither works.  

0
All Courses

From novice to tech pro — start learning today.