oxicottin
Learning by pecking away....
- Local time
- Today, 15:31
- Joined
- Jun 26, 2007
- Messages
- 888
Hello, I have a switchboard I been building and im now stuck at its security and where to put the code to check for security. Well I know where its just not working and only runs through Case 1. What I want is each page has a security of 1, 2 or 3 and if your security is a 1 then you can only see SecurityLevel 1 and if your a 2 then you can see SecurityLevel 1 and 2 and if your a 3 then you can see SecurityLevel 1, 2 and 3.
I tried adding the code below to the [frm_Switchboard] Private Sub FillOptions() in place of and it just runs through Case 1.
I tried adding the code below to the [frm_Switchboard] Private Sub FillOptions() in place of and it just runs through Case 1.
Code:
'Assign a security level number to variable Security
SecurityLevel = DLookup("UserSecurityType", "tbl_LoginUser", "[fOSUserLoginName] = '" & fOSUserName() & "'")
Dim SecurityLevel As Integer
Select Case SecurityLevel
Case 1 'Show buttons only for SecurityLevel 1
Me("Option" & rs![MenuSequentialNumber]).Visible = True
Me("OptionLabel" & rs![MenuSequentialNumber]).Visible = True
Me("OptionLabel" & rs![MenuSequentialNumber]).Caption = rs![MenuPageTitle]
rs.MoveNext
Case 1, 2 'Show buttons only for SecurityLevel 1, 2
Me("Option" & rs![MenuSequentialNumber]).Visible = True
Me("OptionLabel" & rs![MenuSequentialNumber]).Visible = True
Me("OptionLabel" & rs![MenuSequentialNumber]).Caption = rs![MenuPageTitle]
rs.MoveNext
Case 1, 2, 3 'Show buttons only for SecurityLevel 1, 2, 3
Me("Option" & rs![MenuSequentialNumber]).Visible = True
Me("OptionLabel" & rs![MenuSequentialNumber]).Visible = True
Me("OptionLabel" & rs![MenuSequentialNumber]).Caption = rs![MenuPageTitle]
rs.MoveNext
Case Else
'If you dont have a security level then make it same as Case 1
End Select
Wend
End If