Locking down records?

RSW

Registered User.
Local time
Today, 11:56
Joined
May 9, 2006
Messages
178
Is there any way to "lock down" newly created records somehow, so that only the person who created them can edit them after the fact?

Obviously, this would require some kind of system where everyone logged in with some kind of userID and password...and even then, I don't know how such a security system could be set up.

Is this possible? If SO, are there any examples of it anywhere that I could check out?

Thanks in advance!
 
You can use the fOSUserName code found here

http://www.mvps.org/access/api/api0008.htm

to get the current user logged into the computer and then you could, in the On Current event use:

Code:
If Not Me.NewRecord Then
   If Me.YourUserNameField = fOSUserName Then
      Me.AllowEdits = True
   Else
      Me.AllowEdits = False
   End If
End If

That is assuming you have the field "YourUserName" in the table that you are restricting and in the Form's AfterUpdate or BeforeUpdate event sets the username to the currently logged in user:
Code:
Me.YourUserName = fOSUserName
 
Wow, I'll try that out. Thanks!
 

Users who are viewing this thread

Back
Top Bottom