Programmatically change the Caption Prior to Printing

sportsguy

Finance wiz, Access hack
Local time
Today, 04:09
Joined
Dec 28, 2004
Messages
363
Those still keeping the genius title,

I have a basic report which runs based upon a couple of drop down boxes from a form. The report runs fine, but what I want to do is to update the report Caption prior to printing so that the print to PDF will have the correct file save as name, and I don't have to rename the report each time.

The caption needs the fiscal year and period, the calendar month, the Operation or region number, the operation or region name, and then the report name.

If you have any suggestions, I will be willing to explore them, but so far, i haven't been able to figure it out. . .

thanks in advance,

sportsguy
 
You can set the caption in the report's open event:

Me.Caption = "Test" & Format(Forms!frmReports.txtFmDate, "yyyymmdd")
 
Ah, its the On Open event, that's what I was missing. .

thanks

sportsguy
 
Thank you, Thank you Thank you!

you just saved hours of time

Code:
Me.Caption = Forms!Home.cboYYYYMM & " " & Left(ReportTitle(Forms!Home.cboYYYYMM), 3) & " " & Forms!Home.cboOperation & " " & DLookup("[Operation]", "REGION", "[RegionID] = Forms!Home.cboOperation") & " Op Coverage Trend"

sportsguy
 
No problemo, glad it worked for you.
 

Users who are viewing this thread

Back
Top Bottom