• Current User (97 sr2)

    Author
    Topic
    #367948

    I need to log the current user name when a record is added, deleted, changed. Any ideas from the pros? Thanks in advance, DP

    Viewing 1 reply thread
    Author
    Replies
    • #575252

      I have been using the following on NT4, maybe you could too.
      Set up a module with the following:

      Declare Function GetUserNameA Lib “advapi32.dll” (ByVal lpBuffer As String, nSize As Long) As Long

      Public Function GetUserName() As String
      Dim UserName As String * 255
      Call GetUserNameA(UserName, 255)
      GetUserName = Left$(UserName, InStr(UserName, Chr$(0)) – 1)
      End Function

      Then to user it is simply:
      dim txtUserName as string
      txtUserName = GetUserName

      Hope this is useful,

      Pat

    • #575317

      If you are running with Access security enabled you can simply user the CurrentUser() function to get who the user is logged in as. If Access security is not enabled then the CurrentUser() function will always return

    Viewing 1 reply thread
    Reply To: Current User (97 sr2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: