[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

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???
0
GR82BBlondie
Asked:
GR82BBlondie
  • 2
1 Solution
 
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
 
GR82BBlondieAuthor Commented:
Chose not to pursue this.  

Thank you.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now