Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access - Add "last revised date"

Status
Not open for further replies.

cantes903

Programmer
Aug 7, 2003
4
US
I think my question will be pretty easy to solve, I just can't figure out how to do it! I am creating a report in Access and at the bottom want to add a "last revised" date. In other words, I want to be able to look at that date and see the last time someone edited anything.

Thanks in advance!
 
This will require a bit of work on your part. Access cannot determine a record's last edited date - so you'll need to set it up yourself. The method I'll describe below explains how to capture the date and time of a records's last edit.

To report on a record's last edited date/time you need to setup your Form(s) to automatically capture that data and save it to the record at the time the change occurs. You'll need to create an additional field within your table(s) which will store this information. You'll probably want to name it something like LastModDateTime.

Then - Somewhere within your form(s) create an invisible text box named LastModDateTime and set its control source as the LastModDateTime table field.

Then - Create an AfterUpdate event for the form as follows:
Me.LastModDateTime = Now()
This will capture the date/time the record was modified.

On your report show the LastModDateTime field. Keep in mind that the date is captured on a record-by-record basis so if the report lists multiple records make sure you display the LastModDateTime for each one.

After you have your design implimented, you may want to go even further and create reports that show all records modified within the last month, last week, last 3 days, or whatever. For an example query used to capture this data - see this thread: thread701-595636

Hope that helps!

--
Mike

In defeat: unbeatable. In victory: unbearable. -- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top