Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004

    Unanswered: Identifying old records by the User which created them!!!

    I have now found a way to keep a log of the Users who create / update new records in a form within my database. However, this now only provides the Users who create / ammend new records...

    Is there any way I can obtain Users who created all previous records???

    Somebody please help!!!

  2. #2
    Join Date
    Aug 2004
    Nope! Once the ldb file has been closed there is no way to determine the input user. (that I'm aware of ).


  3. #3
    Join Date
    May 2004
    Care to share you method? I have been thinking of doing that too and would like to see an example.

  4. #4
    Join Date
    Aug 2004
    This is a bit of code I use. It gets the name of the computer the data is being entered from. I can't remember where it came from so I humbly apologize to the author of whom credit must go.

    As the prog this is being used in doesn't have any login procedure, the computer name is the only thing available.

    First add a new field to table you wish to store the computer's name into (say entryby with text 30). Put this next bit in somewhere accessible (say a module)

    Option Compare Database
    Option Explicit
    Private Declare Function apiGetComputerName Lib "kernel32" Alias _
        "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    Function fOSMachineName() As String
    'Returns the computername
    Dim lngLen As Long, lngX As Long
    Dim strCompName As String
        lngLen = 16
        strCompName = String$(lngLen, 0)
        lngX = apiGetComputerName(strCompName, lngLen)
        If lngX <> 0 Then
            fOSMachineName = Left$(strCompName, lngLen)
            fOSMachineName = ""
        End If
    End Function
    Then it's just a simple case of calling the function and storing the info into a hidden field (the one you created earlier) on your form. Like so...

    me!entryby = fOSMachineName


  5. #5
    Join Date
    Mar 2004
    Nashville, TN
    I thank you for that code. I may have to use that one myself. I was using another method since I have a login, but I am not sure when I rebuild my database if I want to go that route or not so you have helped me solve one reason of going that route.

    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting by Patriot Designs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts