Full Version: Show the Date of last Database update
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
mfetterhoff
Hello Board

I would like to display on my form, the date that the Database records were last updated. (not viewed, but actually changed) ..What is the bestest easy way to do this?
Doug Steele
Access doesn't capture that information, so you're going to have to do it...

One way would be to add a LastUpdated field to each table, and ensure that it gets updated in the BeforeUpdate event of each form. Then, you'll have to run a query against the tables to determine the greatest value of the LastUpdated field.

Another way would simply be to have a LastUpdated table with a single row in it, then update that field in the AfterUpdate event of every form.
Keaian
Depends on how you have your database setup. If you have a primary table that is relationship to all the child tables then it's pretty easy. Just add a field to that table and name it LastModified. Then on your forms you can add in an event on the properties of the form. On Data Change. Update that field to be the date. If you have the modified field on the current form as a hidden field makes it even easier.

So it would look like this.

me.modifieddate = Now()

or

me.modifieddate = Date()

Doug Steele
<picky>
You said to call the field LastModified, yet your code is updating modifieddate...
</picky>
Keaian
hahahahaha.. well.. you know what i meant smile.gif.

mfetterhoff
EXCELLENT!! Thank-you, Gentlemen!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.