Full Version: Changing label field on a report
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
traveler
I am trying to set-up a printable version of graphic charts and have set-up the report and can successfully change the chart title that displays by changing the caption property of the label field. All charts are driven off the same data table and I have a subform (continuous form) that displays the data for each of the chart variables. I want to change the labels on this subform based on the data that is displayed but I can't figure out how to do it. Here are some particulars:

data table = tbl_MData
Report = rpt_4DataSet
subform with data table in it = subprt_4Data
Report subform control where subform is displayed = Reports![rpt_4DataSet]![Legend]

There are 4 Label Controls in the subform header called:
Label_Data1
Label_Data2
Label_Data3
Label_Data4

I want to change the .Caption of these four Label controls to identify the data being displayed. From the form that calls the report (as a print preview) I tried the following:
Forms![subprt_4Data]![Label_Month].Caption = strArrDataType(0)

I get the following error:

Run-time error '2445':
You Entered an expression that has an invalid reference to the property Form/Report.

I also tried:
Reports![rpt_4DataSet]![Legend].Form![Label_Data1].Caption = strArrDataType(0)

which does not give an error message but it does not display anything either.

Any suggestions?



Edited by: traveler on Thu Feb 22 12:33:17 EST 2007.
PaulBrand
You need to use a text box - not a label
traveler
Not only does it not make any difference whether it is a label control or a text box control, it doesn't make any sense. Why can I do this on a form and not on a report? I tried changing the control to a text box control and it behaves aexactly the same.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.