Full Version: Report Caption
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
MiaAccess
Version is 2003 in 2002 format

Is it possible to add a field to the caption of a report
For example, I have a caption: Payroll by Group
Since I print a lot of reports to a pdf file, I would like the report to automatically be saved as:
Payroll by Group 01-28-05 - the date represent a field called [wedate]

something like: Payroll by Group & [wedate]

Can this be done?
Anne compute.gif
kikovp
Hi,

You could just change the report's caption, in the Report_Open event procedure:

Me.Caption = "Payroll by Group - " & Now()

However, if you must use a value from one of the underlying fields ([wedate]) this cannot be done on the Report_Open (the fields don't have a value yet).

You can do it for example in the PageHeader_Format event:

If Me.Page = 1 Then ' no need to do it more than once
Me.Caption = "Payroll by Group - " & Me![wedate]
End If

Hope this helps
MiaAccess
Thank you, it works
This is going to save me a lot of time not having to rename every file.
Anne
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.