Enable Tab Controls on Form Open

Local time
Today, 11:19
Joined
Apr 29, 2001
Messages
47
I want to disable a tab control page when a form is open, and enable some of the fields if a check box is checked, and some others if another check box is enabled

Can anyone help.

Paul R
 
Controls

In the On Current Event of the form put something like this:

If Me.Checkbox1 = True Then
Me.txtField1.Enabled = True
Else
Me.txtField1.Enabled = False

(Replace Checkbox1 with the actual name of the checkbox and txtfield1
with the name of the textbox)

You can disable controls on opening of a form by putting code in the On Open Event
 
Thanks you for your reply,
but I can enable the tab but I have 3 pages on it I want to disable the 3rd page?
 
Tab

I'm sorry, but I'm confused.

Do you want to permanently disable a tab, or toggle it on and off, or what?
 
Sorry,
On the tab control I have 3 pages, one of the pages I want to be disabled then on one of the other pages I have two check boxes. If a one of the check boxes is checked I want some of the fields on the disable page to be enabled or if the other check box is checked I want the other fields enabled.

hope this is ok
 
Set your page that you want Disabled when the page loads to YES from the properties list in Design mode.

Then, you can have code in the Change event of the tab control to keep the disabled pages from being able to be activated by doing something like this:

Code:
Private Sub TabCtl6_Change()
    If Page8.Enabled = False Then
        Page7.SetFocus
    End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom