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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically Changing the Caption of a Report Label 1

Status
Not open for further replies.

hsp7777

Programmer
Jan 11, 2005
67
US
Greetings,

I was wondering if it is possible to programmatically change the caption of a label on an Access report? For instance, I am attempting to use the following code to change the caption of a label (on a report). I receive no error message during execution, but the caption of the label never changes. Is this even possible?

Code:
strCaption = "Tasks due for the date of : " & Now()
Reports("rptPrintTasks").Controls("lblTasksDue").Caption = strCaption

Thanks in advance!

hsp7777
 
Where are you sticking that code? Try it via the OnOpen statement of the report.
 
I was placing the code behind a command button on a form. Placing the code in the "On_Open" statement of the Report worked.

Thanks again!

hsp7777
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top