Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Wilmington, North Carolina, USA
    Thanked 0 Times in 0 Posts

    Log changes (more specific) (2002)

    Ok, I understand and have implemented code to track changes to my records on forms. Is it possible to display WHICH field on the form was updated, other than putting the code on each object within the form?
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 30 Times in 30 Posts

    Re: Log changes (more specific) (2002)

    If you put code in the After Update event of controls on a form, you will record each chanfe to each control, even if the user doesn't save the record in the end. So you might end up with large numbers of useless orphan log records.

    You could use the Before Update event of the form - this only occurs when a record is actually saved, so you'll only monitor real changes. You could check each editable bound control to compare its Value property to its OldValue property, and write a log record if they are different.

    You'll still have a problem if the update is canceled. To get around that would require more code; you could store the values of all fields in variables in the On Current event of the form, and use the After Update event to compare the new values to those of the variables. Lots of work...

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Evergreen, CO, USA
    Thanked 65 Times in 64 Posts

    Re: Log changes (more specific) (2002)

    Hans has already highlighted the issues with trying to log changes to data in Access - it's lots of work and not very reliable in the end, especially if there is any way to get to the table level and do editing.

    We use a SQL Server back-end, which gives you Trigger functions so you can archive records, and for key tables we do that. Then we use an unbound form with conditional formatting to display any two consecutive records (all are date/time stamped) so any fields that are different are highlighted. You could choose to use the MSDE that comes with 2002 as an ODBC linked back-end and achieve the same result, although the tools for administrative and development work using the MSDE are rather limited. And it is lots of work to implement archiving even in that environment.

Posting Permissions

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