UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Show the Date of last Database update    
 
   
mfetterhoff
post Nov 10 2010, 08:12 AM
Post #1

UtterAccess Addict
Posts: 104
From: Iraq



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?
Go to the top of the page
 
+
Doug Steele
post Nov 10 2010, 09:44 AM
Post #2

UtterAccess VIP
Posts: 17,804
From: Don Mills, ON (Canada)



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.
Go to the top of the page
 
+
Keaian
post Nov 10 2010, 09:46 AM
Post #3

UtterAccess Veteran
Posts: 323



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()

Go to the top of the page
 
+
Doug Steele
post Nov 10 2010, 09:57 AM
Post #4

UtterAccess VIP
Posts: 17,804
From: Don Mills, ON (Canada)



<picky>
You said to call the field LastModified, yet your code is updating modifieddate...
</picky>
Go to the top of the page
 
+
Keaian
post Nov 10 2010, 09:59 AM
Post #5

UtterAccess Veteran
Posts: 323



hahahahaha.. well.. you know what i meant (IMG:style_emoticons/default/smile.gif) .

Go to the top of the page
 
+
mfetterhoff
post Nov 12 2010, 01:48 AM
Post #6

UtterAccess Addict
Posts: 104
From: Iraq



EXCELLENT!! Thank-you, Gentlemen!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 08:46 PM