PC Review


Reply
Thread Tools Rate Thread

Trouble Populating Graph Object Via VBA

 
 
(PeteCresswell)
Guest
Posts: n/a
 
      6th May 2005
Bottom like is that the code works if I break and then resume, but does not work
otherwise.

I'm coding in MS Access, but this being the Excel NG, I thought maybe somebody
here might have been where I am now....

Stepping through the code, it's like the Graph.Datasheet is going
"Poof!".

Later in the code, I set TitleText, so the pointer to Graph is still
there... but sometimes the cell assignments "stick" and sometimes they
don't.

It's just when I right-click the form's Chart object and select 'Edit'
that I can see that the datasheet is empty - even though
ChartTitle.Text shows the value I assigned to it.

===================================================
3800 Set chartRS = curDB().OpenRecordset("SELECT StatDate, StatValue
FROM ttblChart ORDER BY StatDate;", dbOpenSnapshot, dbForwardOnly)

3801 With chartRS
3802 If ((.BOF = True) And (.EOF = True)) Then
3803 bugAlert True, "Unexpected empty recordset"
3804 End If
3809 End With

3810 r = 1 'NB: If we try to load row 1, we do not see it
3811 Set fChart = Chart_Open(myTitle)
3819 Set myGraph = fChart!gphStats.Object.Application

3840 With myGraph
3841 Do Until chartRS.EOF = True
3842 r = r + 1
3843 .DataSheet.Cells(r, 1).ClearContents
3844 .DataSheet.Cells(r, 1) = chartRS!StatDate
3845 .DataSheet.Cells(r, 2).ClearContents
3846 .DataSheet.Cells(r, 2) = chartRS!StatValue
3847 chartRS.MoveNext
3849 Loop

3850 .Chart.HasTitle = True
3851 .Chart.ChartTitle.Text = myTitle
3852 .Chart.Refresh
3859 End With

3900 DoEvents
===================================================
--
PeteCresswell
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
report with Graph Ole object, can I manipulate the datasource of the graph by code? Philip Leduc Microsoft Access Reports 1 27th Jun 2005 12:03 PM
report with Graph Ole object, can I manipulate the datasource of the graph by code? Philip Leduc Microsoft Access 0 23rd Jun 2005 01:34 AM
Trouble Populating Graph Object's .DataSheet Via VBA PeteCresswell Microsoft Access Reports 0 10th May 2005 02:03 PM
Trouble Populating Graph Object Via VBA GoogleGroups@FatBelly.com Microsoft Excel Discussion 0 6th May 2005 01:48 PM
Trouble Populating Graph Object Via VBA (PeteCresswell) Microsoft Excel Discussion 0 6th May 2005 02:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:38 AM.