Chart Object Not Updating Properly

  • Thread starter Thread starter Scott Hakes
  • Start date Start date
S

Scott Hakes

I have a report with an embedded chart that does not
always update with each new record. The error does not
occur with any predicable pattern. When the chart is
wrong, it is based on the data for the prior record.

I found an article in the MS support docs for Access97
that describes the same error, and has a fix by altering
the query for the chart. The support doc indicates that
this is a known issue for 97.

I tried the fix in my database (Access 2000) but I'm
still seeing the same problem with the chart not always
updating.

Has anyone else seen this, and have found a fix?

Thanks,

Scott
 
Scott,
The usual "fix" is:

Dim oGraph As Object
Me.Graph1.Requery 'supply your object name vs "Graph1"
Set oGraph = Me!Graph1
oGraph.Refresh
oGraph.Object.Application.Update
Set oGraph = Nothing

Place the code in the On Print section of the report where the graph is
located.

Steve
 
It shouldn't.

The .Requery should update the dataset, the .Refresh should cause MsGraph to
reload the datasheet, and the .Update should save the current data to the
datasheet. Are you using A2k or Ak2?

Steve
 
I'm ashamed to say, Access 97 SR-2.

I can't upgrade until we eliminate a 97 database we use,
which won't be until November of this year. 8-)
 
I think I got it figured out... I don't think I was
setting the oGraph variable to the object correctly.

I used this and it's working now:

Set oGraph = Me.Controls!grpDisposition

(grpDisposition being the name of the chart)

Thanks much for your help! I've got a 52 page report
that has four charts on each page that has been driving
me batty. I've had to manually check each chart to make
sure they updated correctly when I print it. 8-) Now I
don't have to worry about it.
 
Great! A97 is faster than A2k, but we're all carried along by the MS
"tide".
A97 does reference the graph variable a bit differently as you've
discovered.

Steve
 
Back
Top