Disable some feature based on login Info

  • Thread starter Thread starter SF
  • Start date Start date
S

SF

Hi,

I unsuccesfully try to do a web search to look for some information or
sample on how to restrict access to some feature (eg access to some forms or
reports) based on user login name. For example if a user login with admin
right can access to all forms and reports while the one with ordinary right
can only do data entry and is not able to access admin form (like a web base
membership?) etc...

I use Access 2003, SQL Server 2005 backend on XP box
SF
 
Let's assume you have a Users table and a Roles table and the
intersection thereof: UserRoles, and that you have established at
startup time which role(s) the current user is a member of.

My favorite method is to write a function like this in a standard
module:
public function IsMemberOf(byval strRole as string)
'TODO: Test if user is member of the given role
end function

Then in the Form_Open I write:
if not IsMemberOf("Admins") then Cancel=True

-Tom.
 
Hi,

I unsuccesfully try to do a web search to look for some information or
sample on how to restrict access to some feature (eg access to some forms or
reports) based on user login name. For example if a user login with admin
right can access to all forms and reports while the one with ordinary right
can only do data entry and is not able to access admin form (like a web base
membership?) etc...

I use Access 2003, SQL Server 2005 backend on XP box
SF

Download the Microsoft Access 2000 Security FAQ:

http://support.microsoft.com/kb/207793/en-us

Print it out. Read it CAREFULLY.

Get a good night's sleep.

Read it *again*, even more carefully!

Security is the way to do this - but it's fairly difficult to do it well, and
all to easy to do it badly. Follow the FAQ document scrupulously and you
should get what you want.
 
Back
Top