The following will retrieve the logged-on user to the current machine: Option Explicit Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _ (ByVal lpBuffer As String, nSize As Long) As Long Public Declare Function GetUserName Lib "advapi32.dll" _ Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Private Sub Command1_Click() Dim UserName As String Dim ComputerName As String GetUserInfo UserName, ComputerName Text1 = UserName Text2 = ComputerName End Sub Private Sub GetUserInfo(UserName, ComputerName) Dim r&, ret$ 'get the user's name ret$ = Space$(256) r& = GetUserName(ret$, Len(ret$)) UserName = StripNull$(ret$) 'get the computers's name ret$ = Space$(256) r& = GetComputerName(ret$, Len(ret$)) ComputerName = StripNull$(ret$) End Sub