UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> ReportRevisionDate    

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

'   Code courtesy of UtterAccess Wiki
'   http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary
'   Original submission by Dennis Kuhn (UtterAccess Username: doctor9)
'   August 12, 2010
'   You are free to use it in any application,
'   provided this copyright notice is left unchanged.

   ReportRevisionDate = CurrentProject.AllReports(ReportName).DateModified

End Function

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 textbox's ControlSource (There is no need to substitute your report's actual name between the square brackets):


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.

Creative Commons License
ReportRevisionDate by UtterAccess Wiki is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Editing and revision of the content is freely encouraged; for details, see Expected Usage.

Edit Discussion
Custom Search

Thank you for your support!
This page has been accessed 9,343 times.  This page was last modified 09:40, 6 April 2011 by Jack Leach. Contributions by doctor9 and Glenn Lloyd  Disclaimers