Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    24

    Unanswered: Last modified...

    How do i create a "last modified" field in my table? Just a field that keeps the date when i last edited my record...

    Thanks!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Design View and add the column. Make it a Date/Time too ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Having followed M Owens suggestion then you need to place some code in each form that modifies the data (eg edit add or delete) - probably in the before update event. You will need to consider how to handle users cancelling any changes or deletions. Sadly JET doesn't have an automated means of providing a timestamp unlike server SQL engines. So if you are working in the satndard Access environment then you will need to do your own modifications. Howveer a point to be aware of is that the lastedit values will only be set via a form, if you allow users direct table access or forget to apply the lastedit logic to all forms that modify the data then it will not be doen for you. You may also want to consider recording which users did the modification (using an API call NOT currentuser())

    one possibility is to look at the forms on dirty event (if your version of Access supports it)

    you could display the last chaged date on the forms as a locked control and set it each time a change is made in other controls.

    If you want this to be done for you automatically then the most effective way is to use a server backend, depending on budget & experteses could be SQL Server, MySQL or any other db that meets your requirements.

  4. #4
    Join Date
    Sep 2005
    Location
    North Carolina, USA
    Posts
    11
    Similar to the above suggestions, I created a "dateModified" field in my table. It's a date/time field type.

    I also created a macro called "lastModified". In that macro, I have a SetValue action. The item is [dateModified] and the expression is Date().

    On my record maintenance form (where the user enters a new record or modifies an existing one, I called the "lastModified" macro from the Form's "Before Update" event.

    It works great.

Posting Permissions

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