tweetyangel00
Technical User
Hello,
I am using the following function to capture the user ID from the network. It works fine if you are plugged into the network but if you are connected to the network through a VPN connection the user ID does not show up at all. Is there a way around this?
************************************************
Public Function fOSUserName() As String
On Error GoTo fOSUserName_Err
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 = ""
End If
'Debug.Print fOSUserName
fOSUserName_Exit:
Exit Function
fOSUserName_Err:
MsgBox Error$
Resume fOSUserName_Exit
End Function
************************************************
Thank you!
I am using the following function to capture the user ID from the network. It works fine if you are plugged into the network but if you are connected to the network through a VPN connection the user ID does not show up at all. Is there a way around this?
************************************************
Public Function fOSUserName() As String
On Error GoTo fOSUserName_Err
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 = ""
End If
'Debug.Print fOSUserName
fOSUserName_Exit:
Exit Function
fOSUserName_Err:
MsgBox Error$
Resume fOSUserName_Exit
End Function
************************************************
Thank you!