Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If It Can Be Done - Change a Report Title in VBA?

Status
Not open for further replies.

justagrunt

Technical User
Oct 10, 2002
132
Greetings.
How does one change a report title in VBA.
Two forms, same information.
One is a Proforma Invoice, the other a Commercial Invoice.
Without creating another report template can I change a label or unbound text box, text, to read either Proforma or Commercial, in VBA when prompted prior to printing.
Thanks
Kind Regards
Bill
 
In the OnOpen event procedure you can change the .caption property of a label.
Code:
Me![Report_Title].Caption = [red]vReportName[/red] & " Invoice"

Create a database level Global variable called vReportName
Code:
Global vReportName as string

Now in the form where you call up the printing of the report just store either "Performa" or "Commercial" in the variable vReportName. Then call the report.
Code:
vReportName = "Performa"
DoCmd.OpenReport "rptYourReportName"

This should do it for you. Good luck.

Bob Scriver
[blue]Want the best answers? See FAQ181-2886[/blue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top