• Log changes (more specific) (2002)

    Author
    Topic
    #419957

    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?

    Viewing 1 reply thread
    Author
    Replies
    • #949676

      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…

    • #949704

      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.

    Viewing 1 reply thread
    Reply To: Log changes (more specific) (2002)

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

    Your information: