6/15/10

Printing the name of the Report and/or the name of the database on a Report

Sometimes you may want to print a report that has information such as the name of the Report, or the name of the Database, in the Report's footer, to identify the print out. To do this, you need to add a Textbox to the relevant location on the Report, and then set the ControlSource to:

=[Name]

For the name of the Database, you would instead set the ControlSource to:

=Dir([CurrentDb].[Name],16)

Note that we cannot use the VBA constant vbDirectory, and so must instead use the numeric value, which is 16.

http://www.applecore99.com/rpt/rpt018.asp

No comments: