I have a database I'm building, which will pull info from an ODBC Connection.
I'm taking this information, and from there, using the database as a scheduling tool for our production lines. There are forms, append querys, (that run from a macro updating information in the table, ect... I'm trying to capture the user name for every action the user is doing.
I've found the below code, but am not sure what to do with it. I believe you create a module with it, but am unsure how, or if I even can, call the module in query to append the user name to each record from the append query. Please help! LOL
Function UserNameWindows() As String
UserName = Environ("USERNAME")
End Function
or
Public Declare Function GetUserName Lib "advapi32.dll"
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long....
Dim strLen As LongDim strtmp As String * 256Dim strUserName As StringstrLen = 255GetUserName strtmp, strLenstrUserName = Trim$(TrimNull(strtmp))