PDA

View Full Version : Granting permissions on a passwords I've created on forms



wedd
09-15-2010, 12:34 AM
I've created login passwords for both staff and employees (code listed below) and I would like to prevent the employees for getting access to the management details form. The management will have access to making edited changes etc...but I would like to prevent staff from getting access to the management details...any suggestions would be appreciated. One of my forms is entitled management and will create macros solely for their purpose on the database. Thanks!:friends:




Private Sub Password_AfterUpdate()
If Username = "AdminTeam" And Password = "Password" Then
MsgBox "Welcome Staff", vbInformation, "Admin Team"
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
MsgBox "Please re-enter Username and Password"
ElseIf Username = "Management" And Password = "Password" Then
MsgBox "Welcome, manager use caution when applying changes", vbInformation, "Management Team"""
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
MsgBox " Please re-enter your Username and Password"
End If
End Sub

wedd
09-15-2010, 12:38 AM
I've created login passwords for both staff and employees (code listed below) and I would like to prevent the employees for getting access to the management details form. The management will have access to making edited changes etc...but I would like to prevent staff from getting access to the management details...any suggestions would be appreciated. One of my forms is entitled management and will create macros solely for their purpose on the database. Thanks!:friends:




Private Sub Password_AfterUpdate()
If Username = "AdminTeam" And Password = "Password" Then
MsgBox "Welcome Staff", vbInformation, "Admin Team"
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
MsgBox "Please re-enter Username and Password"
ElseIf Username = "Management" And Password = "Password" Then
MsgBox "Welcome, manager use caution when applying changes", vbInformation, "Management Team"""
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
MsgBox " Please re-enter your Username and Password"
End If
End Sub

nepotist
09-15-2010, 07:44 AM
You could write a macro to the button that opens the Management details form to check the current user account using the Currentuser Method. Check it is management or not then open the form.

wedd
09-15-2010, 03:00 PM
many thanks

wedd
09-16-2010, 12:54 AM
I have 2007 and I'm not able to see where I can grant permissions to a user group unlike previous versions of access. Do you have any sample code were I can grant access to a particular usergroup to be able to edit tables and have an exclusive view of a particular form? I have staff using the database but I only want the management to be able to edit the tables and have exlusive rights to a particular form...that is separate from the other forms the staff are using. any ideas how I can do this on access 2007? Many Thanks :-)

hansup
09-17-2010, 01:43 PM
I have 2007 and I'm not able to see where I can grant permissions to a user group unlike previous versions of access.

Sounds like you're referring to ULS (Jet user level security). ULS is still available in Access 2007, but only for the MDB database format. ULS is not supported in the new ACCDB database format.

So if your database is ACCDB, try saving it as MDB ... then see if the features you want are available.