C
caagaard
Hi,
I have a form with some graphs. I also have a command button that refreshes
the data in a particular graph named CH_VAR_TYPE_GROUP. Besides the requery,
a click on the button should also update the name of the first data series in
the data sheet with a new title ("New title"). Here is the code:
Private Sub Generate_objects_Click()
Me.CH_VAR_TYPE_GROUP.Requery
Set gchart = CH_VAR_TYPE_GROUP.Object
gchart.Application.DataSheet.Range("A0").Value = "New Title"
gchart.Refresh
End Sub
The problem with this is that no matter how I arrange the code, the requery
is done as the last thing and this means that my change of title in the data
sheet is overwritten! This happens even though the requery appears as the
first thing in the code or even if the requery code is put in another sub and
then called from the button code. Why is this the case and is there a way to
work around this problem? (without seperating the two "actions" completely -
eg. two different command buttons)
Thanks in advance
I have a form with some graphs. I also have a command button that refreshes
the data in a particular graph named CH_VAR_TYPE_GROUP. Besides the requery,
a click on the button should also update the name of the first data series in
the data sheet with a new title ("New title"). Here is the code:
Private Sub Generate_objects_Click()
Me.CH_VAR_TYPE_GROUP.Requery
Set gchart = CH_VAR_TYPE_GROUP.Object
gchart.Application.DataSheet.Range("A0").Value = "New Title"
gchart.Refresh
End Sub
The problem with this is that no matter how I arrange the code, the requery
is done as the last thing and this means that my change of title in the data
sheet is overwritten! This happens even though the requery appears as the
first thing in the code or even if the requery code is put in another sub and
then called from the button code. Why is this the case and is there a way to
work around this problem? (without seperating the two "actions" completely -
eg. two different command buttons)
Thanks in advance