Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87

    Unanswered: Creating a log file/table

    is there any way of creating a log file or table that will log all changes to a database?

    I've seen this post http://www.dbforums.com/showthread.p...+form+to+table

    but I'm wanting to log all changes regardless of whether it's adding a new record, deleting a record, or changing the data.

    Anyone any ideas.

    Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Posts
    199
    No way in MS JET (that means you use MS Access native data base), you need tracking changes via forms/codes.
    Unfortunatelly MS Access MDB doesn't have triggers.
    Last edited by Kakha; 02-12-04 at 09:16.
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  3. #3
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266

  4. #4
    Join Date
    Feb 2004
    Location
    Houston TX
    Posts
    23

    Smile

    This is not a complete soloution to your problem but might be helpful. It will only keep track of updates changes and additions but not deletions. As this lets you keep the log on a record by record basis.

    Before you start recording, make sure that there is a field to capture that information inside the table itself corresponding to each record. For now lets assume that field is named "modified_date".

    The way to do it is once you have your form/input screen setup, go the properties of the form then goto the "EVENTS" tab. There you will find a property "ONDIRTY", click in that property's value, a drop down menu button and an event builder button (...) will apprear, click on the event builder button. This will take you the vb code for that form.

    just adapt accordingly and type this line in there.

    Private Sub Form_Dirty(Cancel As Integer)
    Me.[modified date] = Now()
    End Sub

    this will give you the last updated change time. If you want to keep all records, you might have to make another memo field and append the prievious data in there by invoking an append qry before the update triggers (just a sugesstion).

    Hope it helps
    Believe Everybody Trust Nobody

  5. #5
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87

    Thanks!

    thanks both of those look like possible options.

Posting Permissions

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