i found this code on here a while ago and use it all the time.
add this code to a module:
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function fWin2KUserName() As String
Dim lngLength As Long, lngx As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLength = 255
lngx = apiGetUserName(strUserName, lngLength)
If lngx <> 0 Then
fWin2KUserName = Left$(strUserName, lngLength - 1)
Else
fWin2KUserName = "unknown"
End If
End Function
then to use it do something like this:
textbox = fWin2KUserName()
or you could use:
textbox = Environ("username")