User power

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

UP
==================================
Greeting,
I have created the below code and I placed it in event on load of the main
form. It works with only if the user added to the table or not. What I want
to do is set up more user power (read, write, delete, and full control. How
to do that with same table of user power please??
Dim CurrUser As String ' once user login to db
Dim allowUser As Variant ' the allowed users
'========================= to get cuurent user
CurrUser = NetworkUserName()
allowUser = DLookup("[EmployeeID]", "Employee Privileges", "[EmployeeID] ='"
& CurrUser & "'")
If allowUser > 0 Then
Me.Command37.Enabled = True
Me.Command38.Enabled = True
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowDeletions = True
Me.AllowEdits = True

Else
Me.Command37.Enabled = False
Me.Command38.Enabled = False
 
Hi Jon

What you are looking is "very" complex. You would need to add a field to
the table say [Level]
Poss levels could be
Read
Write
etc
etc.

You would then need to defind which user had which rights - this bit is
quite simple - just give them a password that is inked to the [level] etc.

Now comes the problems - you will need to write code to enable or disable
various access functions linked to the level of the user definded by their
password.

But don't forget that that many people (almost everyone on this forum) could
get round this is in about 5 seconds.

Can I suggest you don't bother doing it yourself. You should spend the time
you would take to wite your code in learning access user level security.
This is already built into access.

Have a look at this (or do a google search)
http://office.microsoft.com/en-us/access/HP030704101033.aspx

good luck with your project
 
Back
Top