I don't remember wher I got this:
In the Declarations section of VBA->
Declare Function GetUserName Lib "ADVAPI32.DLL"
Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
Then write the function:
Function LogonUserName()
Dim S As String
Dim N As Long
Dim Res As Long
S = String$(200, 0)
N = 199
Res = GetUserName(S, N)
LogonUserName = Left(S, N - 1)
End Function
then:
User_id = LogonUserName
Returns the UserID of the current user..