Issues with repainting a MSGraph object 
March 11th, 2006, 09:25 AM
| | | |
I have a unbound MS graph object built as a pie chart that I set to a
value list and I am updating programatically. Everything works except
that the graph does not repaint except for when the entire subroutine
is completed.
I launch the sub from a command button on the same tab as the graph
object. I have tired to force a requery of the msgraph, a refresh of
the form and even a repaint of the form. I have put in waits and
msgboxs to see if it is a timing / load issue. No luck I simply can
not get the chart to update until I exit the subroutine back to the
form.
Any ideas? Any events I am missing?
Thanks | 
March 11th, 2006, 01:05 PM
| | | | re: Issues with repainting a MSGraph object
Have you tried
Me.MyGraph.Requery
??
Linda
"Scott" <sharrisct25@hotmail.com> wrote in message
news:1142068663.379164.25990@i40g2000cwc.googlegro ups.com...[color=blue]
>I have a unbound MS graph object built as a pie chart that I set to a
> value list and I am updating programatically. Everything works except
> that the graph does not repaint except for when the entire subroutine
> is completed.
>
> I launch the sub from a command button on the same tab as the graph
> object. I have tired to force a requery of the msgraph, a refresh of
> the form and even a repaint of the form. I have put in waits and
> msgboxs to see if it is a timing / load issue. No luck I simply can
> not get the chart to update until I exit the subroutine back to the
> form.
>
> Any ideas? Any events I am missing?
>
> Thanks
>[/color] | 
March 11th, 2006, 10:55 PM
| | | | re: Issues with repainting a MSGraph object
Scott wrote:[color=blue]
> I have a unbound MS graph object built as a pie chart that I set to a
> value list and I am updating programatically. Everything works except
> that the graph does not repaint except for when the entire subroutine
> is completed.
>
> I launch the sub from a command button on the same tab as the graph
> object. I have tired to force a requery of the msgraph, a refresh of
> the form and even a repaint of the form. I have put in waits and
> msgboxs to see if it is a timing / load issue. No luck I simply can
> not get the chart to update until I exit the subroutine back to the
> form.
>
> Any ideas? Any events I am missing?
>
> Thanks[/color]
Are you using MyChartObject.Update at the en of your changes?
I also had the same problem. I found that you had to force the focus to be
on the graph object after working on it.
SetupChart Me![MyGraph], Me![ChartID] 'your code that sets up the chart
Me![MyGraph].SetFocus 'force the focus to be on the chart
It worked for me.
--
regards,
Br@dley | 
March 12th, 2006, 08:15 AM
| | | | re: Issues with repainting a MSGraph object
Ok I was using the MsGraph.Requery method I tried creating a object
reference and using the update method I tried DoEvents and I am a bit
at a loss here.
Interestingly if I put a breakpoint in the code of the command button
that controls the pie chart it actually is updated when I flip back to
the form from the VB editor. But without the breakpoint the chart does
not show until all the code in the button is completed (the graph is
rebuilt about 6 times during this code). I even tried some MsgBoxes
instead of the breakpoint in the code and the chart is not refreshed
when the MsgBox is displayed.
Can anyone think what is special about the breakpoint versus other
interupts like a msgbox etc. Somehow that must be linked to what I
need to solve this.
Thanks | 
March 12th, 2006, 09:55 AM
| | | | re: Issues with repainting a MSGraph object
Scott wrote:[color=blue]
> Ok I was using the MsGraph.Requery method I tried creating a object
> reference and using the update method I tried DoEvents and I am a bit
> at a loss here.
>
> Interestingly if I put a breakpoint in the code of the command button
> that controls the pie chart it actually is updated when I flip back to
> the form from the VB editor. But without the breakpoint the chart
> does not show until all the code in the button is completed (the
> graph is rebuilt about 6 times during this code). I even tried some
> MsgBoxes instead of the breakpoint in the code and the chart is not
> refreshed when the MsgBox is displayed.
>
> Can anyone think what is special about the breakpoint versus other
> interupts like a msgbox etc. Somehow that must be linked to what I
> need to solve this.
>
> Thanks[/color]
Did you try setting the focus to the graph object after your code has
finished? Works for me.
Me![myGraph].Setfocus
Took me ages to discover that solution.
--
regards,
Br@dley | 
March 12th, 2006, 05:55 PM
| | | | re: Issues with repainting a MSGraph object
Unfortunatly yes, I have added that to my code as to your previous
select. It is almost line the refresh is getting suspended, delayed or
prevented by the rest of my code until there is a interupt like a
breakpoint of the code is finished. | 
March 12th, 2006, 10:25 PM
| | | | re: Issues with repainting a MSGraph object
Scott wrote:[color=blue]
> Unfortunatly yes, I have added that to my code as to your previous
> select. It is almost line the refresh is getting suspended, delayed
> or prevented by the rest of my code until there is a interupt like a
> breakpoint of the code is finished.[/color]
Maybe post your code....
--
regards,
Br@dley |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,702 network members.
|