This is part of a common front-end that each user has a copy of.
The code has been in use by multiple users for many years.
This is the only user having this issue.
It's possible this user might have a different operating system. I'll have to check.
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function fOSUserName() As String
' Returns the network login name
On Error GoTo ER
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
Exit Function
ER:
MsgBox Err.Description, , "fOSUserName"
fOSUserName = vbNullString
End Function