Reputation: 16687
I have a subform which sets the RowSource of a Microsoft Chart 5.0 object in its parent form.
EDIT: The Row Source Type for the graph is Value List.
The graph does not paint itself, however, but any action which would generally generate a repaint (drag another Access window over it, minimize it, loss and regain of focus sometimes) does indeed repaint it. In other words, the graph doesn't show or change automatically.
How do I force a repaint of the chart after a subform action?
These have had no effect:
parent.Referesh
parent.Repaint
parent.TheChart.Refresh
And this does not seem to exist, unfortunately:
parent.TheChart.Repaint
Using: Access 2003
Upvotes: 2
Views: 11130
Reputation: 3413
The problem isn't the repainting of the graph. Most likely, the subform that you are using is retrieving data from a query or table.
You must update the values on the "datasource" object, which is providing the subform data (either a query or a table). Then, re-query the graph object in the mainform.
I made a very simple example in my MS-Acess 2000 and it worked great:
t01_fruits
) with three columns (frt_id
, frt_name
, frt_qty
).t01_fruits
and a button. In the OnClick
event of the button, I put just me.graph1.requery
.When I update the fruits quantity in subform, inside mainform, nothing happens with the graph. When I click the button, the graph is updated correctly.
Upvotes: 3
Reputation: 104
I had similar problem like this, having main page with sub-forms, including 2 with graphs - and solution to refresh it was like this:
me.subForm.Requery
me.subForm!Graph1.Requery
Only when you execute commands in this order, it would update graph properly.
I know it's been a while since question was asked, but in case anyone else has issue like this.
Upvotes: 0
Reputation: 1
I also faced same problem in refreshing chart after updating information in form. I got it resolved by re-queering the chart after update of the inbox linking to change of data.
Private Sub txtFinAgreeEnacDt_BeforeUpdate(Cancel As Integer)
Me.graphCRMStatus.Requery
end sub
Private Sub txtFinAgreeEnacDt_AfterUpdate()
Me.Requery
End Sub
Me is the Form holding graph....
Upvotes: 0