dear all
How can the work permission users to Form (frm_Employees) so that, for example, a (admin) has full permission and (user) has only added permission
I hope the amendment to the attached file
dear all
How can the work permission users to Form (frm_Employees) so that, for example, a (admin) has full permission and (user) has only added permission
I hope the amendment to the attached file
Of course you need a table for user security. Then you set the form permissions by code using the OnOpenEvent. Example:
tblUserSecurity_Sec
recid Primary Key
dev yes/no
admn yes/no
sprsvr yes/no
data yes/no
reado yes/no
Permissions would be set when the user Logs In.
Then use Code on the form Open.' DETERMINE USER SECURITY LEVEL
' (strSecLvl is a global variable set in the modGlbVars module)
If DLookup("[reado]", "tblUserSecurity_Sec", "[userID]='" & Me.txtUserID.Value & "'") = -1 Then
strSecLvl = "Read Only"
End If
I did not download your db.
Select Case (strSecLvl) 'Code in Module.
Case "Developer"
'Set appropriate form properties for Developer
Me.AllowAdditions = True
Me.AllowEdits = True
Me.AllowDeletions = True
Case Else
MsgBox "The user name with which you have logged in " & _
"is not cleared for access to this screen." & vbCrLf & vbCrLf & _
"Please check your security settings.", vbCritical, "Security Error !"
DoCmd.Close acForm, Me.Name
End Select
HTH