-
Not a VB question, but I'm here anyway.
In Access, how do you change the Form Caption at runtime? For example:
Code:
Private Sub tabControl_Click()
Select Case (Me.tabControl.Tag)
Case 1: 'CUDOS
ActiveForm.Caption = "CUDOS"
Case 2: 'CAPSIS
ActiveForm.Caption = "CAPSIS"
Case 3: 'MSP
ActiveForm.Caption = "MSP"
Case 4: 'Service Package
ActiveForm.Caption = "Service Package"
Case Else:
ActiveForm.Caption = "Unknown"
End Select
ActiveForm.Refresh
End Sub
-
Just like you said, except remove all instances of the word ActiveForm and the period that comes afterwards. :rolleyes:
-
nope, does not work. I am trying to set the Form.Caption to a something that depends on which Tab I am in on the Tab Control, hence the Case Statement. I tried your suggestion but nothing happened.
-
You can have a Click event for each tab on the control.
Go to the Tab Control's properties while the first Tab is selected, and change the Name property to "CUDOS".
For the second Tab change the Name to "CAPSIS".
And so on.
Then use this code:
Code:
Option Compare Database
Option Explicit
Private Sub CAPSIS_Click()
Caption = "CAPSIS"
End Sub
Private Sub CUDOS_Click()
Caption = "CUDOS"
End Sub
Private Sub MSP_Click()
Caption = "MSP"
End Sub
Private Sub Service_Package_Click()
Caption = "Service Package"
End Sub
Maybe we are talking about completely different things, though?
I wouldn't know, I barely ever use Access. :rolleyes:
-
Thanks Yonatan, I had also thought of that, but it does not work either. Its not that important I just wanted to do it, then when I could'nt I got all upset. Guess I'll just forget it.
Thaks for trying anyway.