A: 

Try this:

Function UserNameWindows() As String
     UserName = Environ("USERNAME")
End Function
JoshJordan
Bear in mind that this can be changed by users/applications...
Mitch Wheat
+5  A: 
Public Declare Function GetUserName Lib "advapi32.dll" 
    Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

....

Dim strLen As Long
Dim strtmp As String * 256
Dim strUserName As String

strLen = 255
GetUserName strtmp, strLen
strUserName = Trim$(TrimNull(strtmp))

Turns out question has been asked before: http://stackoverflow.com/questions/168659/how-can-i-get-the-currently-logged-in-windows-user-in-access-vba/168682

Mitch Wheat
I didn't see that the question has been asked before. Thanks, anyways
Varun Mahajan