**tab control** (1 Viewer)

MS_Access_Amature

Registered User.
Local time
Today, 07:34
Joined
Nov 10, 2010
Messages
56
When my program starts it makes you create an admin account to continue on. Once created, it takes you a form to create users. In this form i have a tab control called MyTabs and it has 3 tabs (tab1, tab2, tab3).
Tab 1 is to create users. I want to disable tab 2 and 3 until at least one user has been created.
I put the following code in the Form Open event but it's still letting me click on the other tabs.

Private Sub Form_Open(Cancel As Integer)

If DCount("Code", "Employees") = 1 Then
me.Tab2.enabled = false
me.Tab3.enabled = false
End If

End sub
 

Adam Caramon

Registered User
Local time
Today, 10:34
Joined
Jan 23, 2008
Messages
822
MS_Access_Amature said:
I put the following code in the Form Open event but it's still letting me click on the other tabs.

When you disable a tab control page, you disable all of the controls on it, but you can still click the tab control page its self.

If you want to make that tab control page inaccessible, set its Visible property to False.
 

Users who are viewing this thread

Top Bottom