P
(PeteCresswell)
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
===================================================
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
===================================================