Programmatically change the Caption Prior to Printing (1 Viewer)

sportsguy

Finance wiz, Access hack
Local time
Today, 01:06
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
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:06
Joined
Aug 30, 2003
Messages
36,140
You can set the caption in the report's open event:

Me.Caption = "Test" & Format(Forms!frmReports.txtFmDate, "yyyymmdd")
 

sportsguy

Finance wiz, Access hack
Local time
Today, 01:06
Joined
Dec 28, 2004
Messages
363
Ah, its the On Open event, that's what I was missing. .

thanks

sportsguy
 

sportsguy

Finance wiz, Access hack
Local time
Today, 01:06
Joined
Dec 28, 2004
Messages
363
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
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:06
Joined
Aug 30, 2003
Messages
36,140
No problemo, glad it worked for you.
 

Users who are viewing this thread

Top Bottom