Hi all, I would like to take the function below and write the user name
to a field on a form and store it in the corresponding table but I'm not
sure how to get to where I'm at to where I need to be.
I'm doing this to track which user made what entry into the database:
Public Declare Function GetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Dim strCompName As String
Dim strUserName As String
Dim lLen As Long
Dim lNum As Long
strCompName = String(255, 0)
strUserName = String(255, 0)
lLen = GetComputerName(strCompName, Len(strCompName))
lNum = GetUserName(strUserName, Len(strUserName))
strCompName = Left$(strCompName, InStr(1, strCompName, Chr$(0)) - 1)
strUserName = Left$(strUserName, InStr(1, strUserName, Chr$(0)) - 1)
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!