Hi All,
Looking for a little help on the above topic if possible...
I have 7 tabs in a tab control and I would like each one to be editable depending on the users' security level (set by Admin)
I have managed to get the following code working for one tab, but I do not have the knowledge to make it work for the rest.
So, just trying to make things more understandable...
Tab Names:
TabUnitInformation
TabUnitHistory
TabLabelChecklist
TabTestBay
TabReturns
TabDemoStock
TabAdmin
User Security Levels and what users with those levels should be able to edit:
1. Admin - No tab restrictions
2. Test Bay - TabUnitInformation, TabLabelChecklist, TabTestBay
3. Returns - TabUnitInformation, TabReturns, TabDemoStock
4. Label - TabUnitInformation, TabLabelChecklist
5. Sales - TabUnitInformation, TabUnitHistory, TabDemoStock
6. User - TabUnitInformation
7. Technical - TabUnitInformation, TabUnitHistory
The code I have written ( which works for whichever tab control I list, but not sure how to write in more than one):
Any help with this would be great...
Thanks guys!!
Looking for a little help on the above topic if possible...
I have 7 tabs in a tab control and I would like each one to be editable depending on the users' security level (set by Admin)
I have managed to get the following code working for one tab, but I do not have the knowledge to make it work for the rest.
So, just trying to make things more understandable...
Tab Names:
TabUnitInformation
TabUnitHistory
TabLabelChecklist
TabTestBay
TabReturns
TabDemoStock
TabAdmin
User Security Levels and what users with those levels should be able to edit:
1. Admin - No tab restrictions
2. Test Bay - TabUnitInformation, TabLabelChecklist, TabTestBay
3. Returns - TabUnitInformation, TabReturns, TabDemoStock
4. Label - TabUnitInformation, TabLabelChecklist
5. Sales - TabUnitInformation, TabUnitHistory, TabDemoStock
6. User - TabUnitInformation
7. Technical - TabUnitInformation, TabUnitHistory
The code I have written ( which works for whichever tab control I list, but not sure how to write in more than one):
Code:
Private Sub Form_Load()
Dim Security As Integer
Me.TxtUserLogin = Environ("USERNAME")
If IsNull(DLookup("UserSecurity", "TblEmployees", "[UserLogin] = '" & Me.TxtUserLogin & "'")) Then
MsgBox "No UserSecurity set up for this user. Please contact Administrator", vbOKOnly, "LoginInfo"
Me.TabUnitHistory.Enabled = False
Else
Security = DLookup("UserSecurity", "TblEmployees", "[UserLogin] = '" & Me.TxtUserLogin & "'")
If Security = 1 Then
Me.TabUnitHistory.Enabled = True
Else
Me.TabUnitHistory.Enabled = False
End If
End If
End Sub
Any help with this would be great...
Thanks guys!!