Full Version: "Last Updated" Record
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
mishchenko
I am trying to figure out an easy way to show a "last updated" timestamp (ideally with both date and time) on my forms. So far, my current solution works as long as the data is updated *only* from within forms. When a table is used to modify a record, that record's "Date Updated" field (something I created) does not reflect the correct date/time.

The solution I use now is using AfterUpdate for each form element to update this field. Here's an example:
CODE
Private Sub Guest_First_AfterUpdate()
[DateUpdated] = Date
End Sub


Does anyone know of a way to reliably track changes to individual record regardless of whether the change was made from a table or form? I would really appreciate some assistance.
freakazeud
Hi,
welcome to UA forums.
NO ONE should directly make changes to records in tables. Your users should not even be able to get to the table level.
Tables/database window should be hidden and your users should use a userinterface (forms/reports) provided by the developer to do what they need to and are allowed to.
To hide the database window go to tools--startup...uncheck show database window on startup and select a form to show instead. This is normally a splashscreen which redirects to a menu/switchboard or the menu directly.
To get back in as the developer hold down shift while starting the db.
BTW...if you want to use date and time then use NOW() instead of Date().
HTH
Good luck
mishchenko
I know that normally the table would be hidden. However, in this case it must remain open to edits. This is a small DB with only about 20 fields and 1000 records ... and, as there aren't many users working on it, there's less potential for corruption or errors. Is there a way to keep track of updates in this kind of scenario?
freakazeud
Hi,
why does it need to "remain open to edits"?
I can't really think of a possible answer to this as everything can be presented through forms for your users.
HTH
Good luck
schroep
Access/Jet does not offer TRIGGERS, so the only way to ensure this field gets updated is to do it in a form and ONLY allow access to the data through a form or forms.

I, too, cannot think of any possible reason a table "must" remain open to direct edits by users. That's bad design, no matter what DB you are using or how many users are in it. Beyond that, you will have lost the integrity of your LASTUPDATED field if you allow it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.