Revision as of 21:07, 13 July 2010
This is a set of instructions to show you how to easily include a report's Revision Date on a report.
First, you must create a User-Defined Function that will return a given report's .DateModified property:
1. Create a new code module, and name it "modReportRevisionDate".
2. Add the following code to the code module:
Public Function ReportRevisionDate(ReportName As String) As Date
ReportRevisionDate = CurrentProject.AllReports(ReportName).DateModified
3. Close and Save the code module.
The function is now ready to use.
4. Open your report in Design View.
5. Add an unbound textbox to the page footer (or wherever you would like the revision date to appear), and add the following as the ControlSource:
This will pass the name of the report to the function, which will return that report's .DateModified property as a Date datatype.
6. Format the unbound textbox to display the date as you want it to appear.
NOTE: This function will not work on a new, unsaved Report. The report must be saved with a name, so that Access can identify which report to get the revision date for.