Identify a user

Groundrush

Registered User.
Local time
Today, 06:33
Joined
Apr 14, 2002
Messages
1,376
I am using a Audit Trail that ghudson posted a while back
and I am trying to figure out how to pick up the user names that have created or changed records

at the moment I get

"New Record added on 07/07/2003 09:40:38 by Admin;"

I know in the code that ghudson posted, it mentions:

sUser = "User: " & UsersID 'You need to identify your users if you are not using Access security with workgroups.
sUser = CurrentUser

Does anyone know how to go about doing that

Thanks for any advice :)
 
The way I get the current user is with this module


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)
ElsefOSUserName = ""
End If
End Function



In a text box Control Source type

=fOSUserName()


Hope this helps

IMO
 
Thank you
I will try that out
 
I created a text box with the control sourse =fOSUserName()
and a module with your code in,
and I am getting an error on "ElsefOSUserName"
at the end of your code

message "Compile error, expected variable procedure not Module"

What am I doing wrong?

We are using Novell on the server and I am assuming that your code will pick up the user names from there, or will it come from the user names in windows?

Thanks for your help..
 
It would be the Windows Network Login Name. I'm not sure how to get the Novell UserName, sorry.

IMO
 

Users who are viewing this thread

Back
Top Bottom