Security based on Windows Login

A

Adriana

I tried Allen Browne's advice on Creating an Audit Log for using users'
Windows Login for security and I keep on having problems. Access's security
features are terrible and I've had way too much trouble with it.

What I need is this...My boss wants users to only be able to edit the
records they created and a history table of what changes and additions were
made. It would be nice if they could see all records, but if not then it's
okay if they only see theirs.

What's the easiest way to go about this? I'm going crazy over here and
tearing my hair out with VBA. Please help me.
 
D

DanielWalters6

If only simple security is needed (no one is really going to try hacking the
system) then you could try (Environ("Username")) to capture the username of
the logged in user.
This works if each person who has access to the database has a different
windows login.

For example:

Dim Username as String
Username = (Environ("Username"))
msgbox (Username)

I personally would add an extra field to the table, called USER.
When a user opens a new record
(Environ("Username")) is automatically entered into the USER field.

Then all you have to do is do a small loop proceedure that runs through all
of the records looking at USER. Not exact syntax!:

BEGIN LOOP
If USER = CURRENT USER (Environ("Username")) then
'Do nothing, employee is allowed to access this record
ELSE
'Disable/Lock record
End If
NEXT ITEM IN LOOP

Hope this helps, let me know how you get on.
 
A

Adriana

Thank you for responding and for your assistance. An I.T. employee helped me
with all the coding for the security and the changes made audit table. The
code is pretty long, so it's a little too long to paste here.
 
D

DanielWalters6

Just glad you got it sorted :)
--
Dan Walters


Adriana said:
Thank you for responding and for your assistance. An I.T. employee helped me
with all the coding for the security and the changes made audit table. The
code is pretty long, so it's a little too long to paste here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top