S
Song Su
I have a table called USERS and a field called USERID
When people click my Page:Student tab, I want to check if the network userid
is found in my users table. If found, enable cmdStudent button. Otherwise,
cmdStudent remain disabled.
Can anyone help?
I use following code to get people's network userid:
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. This is used on frmMainForm
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
End Function
When people click my Page:Student tab, I want to check if the network userid
is found in my users table. If found, enable cmdStudent button. Otherwise,
cmdStudent remain disabled.
Can anyone help?
I use following code to get people's network userid:
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. This is used on frmMainForm
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
End Function