Thank you for the reply.
Im pretty new at this whole coding thing. can you tell where i need to put
this code? do I put it as an onclick event in the scripting or as a module??
So after I finished posting the last message I went back and actually read
the top of the page and saw what to do.
I made a new module and called it Username and pasted the following 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
Then I went to my data access page and put in the following code in the HEAD
section in Script editor
TellerID is my message box I want the Windows User name in.
I am on a Novell network and everybodys windows username is the same as
thier novell username. So I just want to get the Windows name.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.