Tabbed Control

  • Thread starter Thread starter Antonio
  • Start date Start date
A

Antonio

Good morning, everybody.
I have a tab control on a form, with 5 pages. I would
like to disable a button when users click on the tabs and
I was trying to use the Select Case, but I am having some
problems. Can someone help me with it? Thanks, Antonio
 
If you meant you want to disable a CommandButton when the use selects a Tab
Page then you can use the TabControl_AfterUpdate Event using the value of
the TabControl (which is the zero-based index of the active Tab Page).
Something like:

****Untested air-code****
Private Sub TabControl_AfterUpdate()
Select Case Me.TabControl.Value
Case 0, 2, 4
Me.CommandButton.Enabled = False
Case 1, 3
Me.CommandButton.Enabled = True
End Select
End Sub
****Code ends****

(the CommandButton is disabled when the user selects page 1 or page 3 or
page 5 and enabled otherwise).
 
Van T. Dinh said:
If you meant you want to disable a CommandButton when the use selects a Tab
Page then you can use the TabControl_AfterUpdate Event using the value of
the TabControl (which is the zero-based index of the active Tab Page).
Something like:

****Untested air-code****
Private Sub TabControl_AfterUpdate()
Select Case Me.TabControl.Value
Case 0, 2, 4
Me.CommandButton.Enabled = False
Case 1, 3
Me.CommandButton.Enabled = True
End Select
End Sub
****Code ends****

Did you mean the TabControl's Change event here or did they add an update event in
later versions. I don't see one in Access 97.
 
Back
Top