Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Security / April 2007

Tip: Looking for answers? Try searching our database.

Access Security

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ahpitre - 27 Apr 2007 21:38 GMT
Currently have a database where the user logs in his username and password
(not using workgroup security). If a succesful login is made (user & password
exist on the security table), then user's privileges are read from the table,
and these are used to set permissions for Forms/Reports. I tested 1 form to
enable/disable Additions/Deletions/Edits depending on user's privileges.
Instead of having to code this (On Open Event) for each form, I was wondering
if I could use some Global (Module) code that can be used to Open & set
permissions, then I would not need to code each form, just put 1 line in
Form's On Open Event to call the public Function. I can use the Docmd.Open
form with acEdit or acAdd parameters, but If I want to allow deletions but
not Add/Edit, then I can't do this using the Docmd.OpenForm. Any ideas?
Thanks for the help.
Scott McDaniel - 29 Apr 2007 18:43 GMT
>Currently have a database where the user logs in his username and password
>(not using workgroup security). If a succesful login is made (user & password
[quoted text clipped - 8 lines]
>not Add/Edit, then I can't do this using the Docmd.OpenForm. Any ideas?
>Thanks for the help.

You can set the form level properties AllowAdditions, AllowDeletions, etc etc, then do something like this:

Public Function SetSecurity(FormName As String, UserName As String) As Boolean

With Forms(FormName)
 <set your security here>
 .AllowDeletions = UserCanDelete(UserName)
 .AllowAdditions = UserCanAdd(UserName)
End With

End Function

Now add this to each form's Open event:

SetSecurity Me.Name

And each form would "set itself" ... the functions like "UserCanDelete" would simply lookup the necessary permissions in
a table and report back to the SetSecurity function. You could also simply open a recordset in the SetSecurity function
which would gather the current user's permissions, then apply them accordingly (I don't know how your permissions are
stored in your tables, so can't advise there).

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.