Changing a txtBox Caption

J

John C.

I have a report that contains a txtBox which is used for
displaying a report title.

Depending on user information, this title needs to be
dynamic so it can change.

Using the following code, I receive the error message "You
can't assign a value to this object"

Me.txtTitle = "Unit " & varUnit & " Night Shift Log"

This is my first design attempt for a report, do they
function differantly than a form?

How do I manipulate controls on a report?
 
D

Duane Hookom

The text box should be unbound (no control source). Text boxes don't have
caption properties. Labels have captions. I assume you have a text box.
 
J

John C.

I errored when naming the control...it is a LABEL.

None the less, I did attempt to have an unbound txtBox on
the report to perform the same thing, but receive the same
error.

Any more ideas?
 
D

Duane Hookom

The code should be located in the On Format event of the section containing
the control.
Me.lblMyLabel.Caption = "Something"
 
Top