Need help in assigning the NT USERID. In Office 97 I wrote the program this way:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True
' Function GetNtId() As String
Dim NtUsrId As String
Dim indx As Integer
indx = 1
Do
EnvString = Environ(indx)
If InStr(EnvString, "USER=") > 0 Or InStr(EnvString, "USERNAME=") > 0 Then
NtUsrId = Trim$(Mid$(EnvString, InStr(EnvString, "=") + 1, 15))
Exit Do
Else
indx = indx + 1
End If
Loop Until EnvString = ""
GetNtId = NtUsrId
End Function
Access 200 does not like the string EnvString = Environ(indx)
Is there another way to get the NT USERID?
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True
' Function GetNtId() As String
Dim NtUsrId As String
Dim indx As Integer
indx = 1
Do
EnvString = Environ(indx)
If InStr(EnvString, "USER=") > 0 Or InStr(EnvString, "USERNAME=") > 0 Then
NtUsrId = Trim$(Mid$(EnvString, InStr(EnvString, "=") + 1, 15))
Exit Do
Else
indx = indx + 1
End If
Loop Until EnvString = ""
GetNtId = NtUsrId
End Function
Access 200 does not like the string EnvString = Environ(indx)
Is there another way to get the NT USERID?