Hello,
I have a data access page which is linked with a table. Users will enter the data through this particular DAP which is on a web server. I would like the DAP to capture and append the NT login ID of these users who are entering the data into the table.
I used the following code to capture the NTlogin.
When I call this function from a form through a text box, it displays the NT login ID as the default value.
But, when I try to use the same method in a DAP, it is not accepting =fOSUsername() as a default value.
Any ideas?
PS: A begginer...
I have a data access page which is linked with a table. Users will enter the data through this particular DAP which is on a web server. I would like the DAP to capture and append the NT login ID of these users who are entering the data into the table.
I used the following code to capture the NTlogin.
Code:
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
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
But, when I try to use the same method in a DAP, it is not accepting =fOSUsername() as a default value.
Any ideas?
PS: A begginer...
Comment