Using Windows 2000 login User ID for users name

AshikHusein

Registered User.
Local time
Today, 11:30
Joined
Feb 7, 2003
Messages
147
I am working on a multiuser Access project which will be used by about 30 to 40 people in the centre. I am trying to avoid user permissions because users can change every day on an ad hoc basis, which will complicate the purpose for which this project is being designed.

However the managament would like to keep a log of which person views a record or edits a record.

Now every user who will use this database will be on the company network and will have to sign into their computer using their systems ID and password (for Windows 2000). So every user will have a systems user name when they log on to their computers.

Now when I use "CurrentUser" to update the field for the person who has viewed it, it puts in "Admin" into the field, and understandably so because the users dont have to log in to the database using a database id and password.

I would like to know if there is a way to have the field updated with the Windows 2000 user login ID.

There are no security security concerns for the database so far. The management would only like to know who views or edits a certain record.

Will appreciate an insight into the matter on an urgent basis.

Regards

Ashik
 
This should dop the job

Option Compare Database

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function

Thanks
Geoff
 
Thanks!

That helped tremendously!
 

Users who are viewing this thread

Back
Top Bottom