Urgent: Unable to change the RowSource property in a chart object through macro ot code.
Posted on 2002-04-18
In my database, I produce a report with charts. These charts are not to be based on records in a table but on calculated controls on the report itself.
To do that, I want to be able to change the rowsource property through either a macro or some code started when the report is open. (note: the Rowsourcetype is set to Value List and column count to 4.) It seems simple yet it does not work!
Both when I use a macro (SetValue) or the code below, I receive the following error message: “Run-time error ‘2455’: you entered an expression that has an invalid reference to the property RowSource.”
However, when I use the same code in a form, it works fine. Should I understand that what is true for a form in not true for a report. Or is there a way to solve this issue?
Private Sub Report_Open(Cancel As Integer)
Dim Chartsource As String
Chartsource = "Road ; Paved ; Maintainable ; Maintained ; Country ; .95 ; .50 ; .25 ; Region ; .10 ; .45 ; .35"
Me!Network_condition_graph.RowSource = Chartsource