Form Tab Programming

  • Thread starter Thread starter Russ via AccessMonster.com
  • Start date Start date
R

Russ via AccessMonster.com

Is there a way to disable all other tabs by say having a check box on the
first tab and unless it is checked the other tabs will not be enabled /
active? Any help would be great!
 
Russ via AccessMonster.com said:
Is there a way to disable all other tabs by say having a check box on
the first tab and unless it is checked the other tabs will not be
enabled / active? Any help would be great!

You can enable and disable the other tab pages; e.g.,

Me.Page2.Enabled = Me.chkMyCheckBox.Value
Me.Page3.Enabled = Me.chkMyCheckBox.Value
' ... etc. ...

However, this will leave the page tabs clickable -- only the controls on
the pages will be disabled.

You could hide the other pages, and only make them visible when the
check box is checked:

Me.Page2.Visible = Me.chkMyCheckBox.Value
Me.Page3.Visible = Me.chkMyCheckBox.Value
' ... etc. ...

Or you could use code in the tab control's change event that keeps it on
the first page unless the check box is currently checked:

'----- start of example code -----
Private Sub tabMyTab_Change()

If Me.chkMyCheckBox= False Then
If Me.tabMyTab <> 0 Then
Me.tabMyTab = 0
End If
End If

End Sub
'----- end of example code -----
 
Dirk,
Thanks for the great ideas, I will give them all a try and see what works
better for my application.
Again Thans!
 
Back
Top