Wack this code into a new module, then call fntUserId and it will return the
NT user name
ie msgbox fntUserId()
=======================
Option Compare Database
Option Explicit
Public gstrUserId As String
Declare Function nmGetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, nSize As Long) As Long
Public Function fntUserId() As String
'get the loginid of the current NT user
Dim strBuffer As String * 20
Dim lngLenBuffer As Long
Dim lngOk As Long
lngLenBuffer = 20
lngOk = nmGetUserName(strBuffer, lngLenBuffer)
gstrUserId = Left(strBuffer, InStr(1, strBuffer, Chr(0)) - 1)
fntUserId = uCase(gstrUserId)
End Function
=======================
"Ryker" <ra*****@choctaw.orgwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
>I have a multi user database that I would like to be able to track user
actions. Ex Whenever a user creates a new employee record, I would
like to "stamp" their id on the record as the one that created it.
Also, whenever they run a report, I would like their id automatically
printed on the report as the one running it.
How to do this?