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

Changing report label

Status
Not open for further replies.

Muttley

MIS
Nov 22, 2000
50
US
Hi

Is it possible to conditionally format a label or text box on a report so that the title of the report changes depending on another factor (e.g. Whether or not a control on a separate form is null or not).

I've tried to assign a value and I get a run time error 2448 ("You can't assign a value to this object"). Is there any way I can get around this?

TIA

Muttley
 
Set up a text box that checks the control's value on your form and assigns the value for the titlewhen the report is run. The control source of the text box will look like this:

=iif([Forms]![FormName]![ControlName]="ValueToFind","Report Title if Value is True","Report Title if Value is False")

That will do what you're looking for.

Joe Miller
joe.miller@flotech.net
 
Hi (again) Joe

I got around this by using the following syntax:

IsNull(Form_frmMenuReports.txtFrom) then
Reports!repWriteOffs!lblTitle.Caption = "Title"

etc.

It just annoys me why there are so many inconsistencies with the way Access does things - I've done exactly the same for Form labels by using me.lblX.Caption = "Title"

Thanks again...Muttley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top