Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004

    Unanswered: log the data that users changed.

    I have a database that Access as front end and sql server as backend. Now we would like to log some of data that has been changed by users. For example, we have status that is dropdown box. We would like to log the Status when user change the status using the dropdown box. In the log file, i would like to save primary key ID and the original status and the status that has been changed. also log the date he or she changed, and the user name. I want to create another table call log to save these data. Is there nice and quick way to do this? Many thanks.
    Last edited by yyu; 03-05-07 at 09:59.

  2. #2
    Join Date
    Jan 2007
    Provided Answers: 10
    So you want an audit log? I#ve never made one myself personally but here's an idea...
    After a record is changed and saved - you can run an event to write a line of text to a text file - perhaps create this in a module and pass a variable or two to it (such as username and a description of what is being changed).
    Not ideal, but it's a possible solution
        Dim txtfso As FileSystemObject
        Dim txtfile As file
        Dim txtstrm As textstream
    'ommit the next 2 lines when the file exists already
        Set txtfso = New FileSystemObject
        txtfso.CreateTextFile (FileName)
        Set txtfile = txtfso.GetFile(FileName)
        Set txtstrm = txtfile.OpenAsTextStream(FileName)
        txtstrm.WriteLine "anything i want to write"
    Home | Blog

  3. #3
    Join Date
    May 2005
    I've never actually done this before, as I would think this would amount to a very large table quite quickly, but if you are set on doing this, look at the Before Update event and After Update event, then look at capturing the username. But others may have better ideas.
    Me.Geek = True

  4. #4
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    You might want to take a look at Allen Browne code for an audit log:

    Like God, in the beginning (of Access, that is) there was Allen Browne!
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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