Link to home
Start Free TrialLog in
Avatar of desmarch
desmarch

asked on

Urgent: Unable to change the RowSource property in a chart object through macro ot code.

Hi everybody,

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?

Thanks.

Arnaud


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
End Sub
ASKER CERTIFIED SOLUTION
Avatar of xtrahands
xtrahands

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
for desmarch

No comment has been added for the last two months.
So it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)