DatabaseLessons.com

'Serving the Microsoft® Access
Community since 1997'

News/Blog
Tables
Queries
Forms
Reports
Modules
Miscellaneous
Subscribe
Free Samples
Videos
Services
Links
About Us

 

 

Database Name on Report

As reports are printed from a database, it is often useful to have the name of the database printed on the output. For example, you may have a number of versions of a particular MS Access database. As tests are done and reports printed, you need to know which version of the database it came from. Another way in which this method can be useful is when you copy a common report type from one database to another. If you hard code the database name, then everytime you move the report, you have to edit the name.
  • Create an unbounded text box on the report, most likely in the page footer or report footer.
  • Make the text box's control source equal to "= currentdb.name".
If you appreciated this tip, consider subscribing to our ezine. To do so, click on the Subscribe button to the left.

(article continues after sponsor spot)



NOTE: All the VBA code segments on the Database Lessons site assume that you have DAO references active. If you are not sure what this means, and you are using Microsoft Access 2000 or higher, click here.

Happy Coding

 
Note: This web site dedicated to MS Access database users is an independent publication of Richard W. Killey and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft® Corporation.
 

 

© 2006, 2007, 2008 Richard W. Killey. All Rights Reserved. - Privacy Policy