Dim sUser As String
sUser = UCase(Environ("username"))
[\code]
This utilizes the use of the USERNAME environment variable. Another way to accomplish this is using the API:
[code]
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetCurrentUser() As String
Dim lpBuff As String * 25
Dim ret As Long
ret = GetUserName(lpBuff, 25)
GetCurrentUser = UCase(Left(lpBuff, InStr(lpBuff, Chr(0)) - 1))
End Function