Connecting Tech Pros Worldwide Help | Site Map

Graph Chart using Access 2k3 with 2k format

Dave
Guest
 
Posts: n/a
#1: Nov 13 '05
I'm trying to follow the examples in VBAGRP9.CHM and/or VBAGR10.CHM with no
success. I'm trying to Chage the Legend Colors based on Content so that I
can establish a certain color format on Content. The Chart will reside on a
Report and possibly converted to a 2002 format. Currently I'm using the
following code with Microsoft Graph 11.0 Object Library referenced.:

With myChart.Legend
For i = 1 To .LegendEntries.Count
.LegendEntries(i).Font.ColorIndex = 5
Next
End With

The Errors that I'm getting are either:

2771 The bound or unbound object frame you triedto edit doesn't contain an
OLE object.

or

438 Object doesn't support this property or method.


Please help me Master(s), so that I can justify my existance.
Dave
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Graph Chart using Access 2k3 with 2k format


I can't believe that someone hasn't figured this out! After a long
afternoon of playing around, I discovered that Graph.Chart 8.0 doesn't
like a Record Source on the Report. If you're assigning a Record
Source in the OnOpen Event...Remove that to. Everything works after
that.


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
1 On Error GoTo Err_dF
5 Dim chr As Graph.Chart
10 Dim j As Integer
15 Dim X As String
20 Set chr = myChart.Object
25 With chr.Legend
30 j = .LegendEntries.Count
35 For i = 1 To j
40 X = .Application.DataSheet.Cells(i + 1, 1)
45 Select Case X
Case "Actual"
50 .LegendEntries(i).LegendKey.Interior.Color = 0
Case "PM/Engr."
55 .LegendEntries(i).LegendKey.Interior.Color =
32768
Case "Equip"
60 .LegendEntries(i).LegendKey.Interior.Color =
65535
Case "Matl"
65 .LegendEntries(i).LegendKey.Interior.Color =
16711680
Case "Merit"
70 .LegendEntries(i).LegendKey.Interior.Color =
39423
Case "JEG_SC"
75 .LegendEntries(i).LegendKey.Interior.Color =
255
Case "BPMISC"
80 .LegendEntries(i).LegendKey.Interior.Color =
16763904
Case "BP_SC"
85 .LegendEntries(i).LegendKey.Interior.Color =
13209
Case "Conting"
90 .LegendEntries(i).LegendKey.Interior.Color =
16751052
Case "UN"
95 .LegendEntries(i).LegendKey.Interior.Color =
RGB(255, 255, 255)
100 End Select
105 Next
110 End With
Exit_dF:
115 Exit Sub
Err_dF:
120 If Err.Number = 1004 Then
125 Resume Next
130 Else
135 MsgBox Err.Number & " " & Err.Description & chr(13) &
chr(10) & "Detail Format Line No: " & Erl
140 Resume Exit_dF
145 End If
End Sub


Dave_Burkett@SBCGlobal.Net (Dave) wrote in message news:<8cdec7ec.0409200508.9d985c2@posting.google.c om>...[color=blue]
> I'm trying to follow the examples in VBAGRP9.CHM and/or VBAGR10.CHM with no
> success. I'm trying to Chage the Legend Colors based on Content so that I
> can establish a certain color format on Content. The Chart will reside on a
> Report and possibly converted to a 2002 format. Currently I'm using the
> following code with Microsoft Graph 11.0 Object Library referenced.:
>
> With myChart.Legend
> For i = 1 To .LegendEntries.Count
> .LegendEntries(i).Font.ColorIndex = 5
> Next
> End With
>
> The Errors that I'm getting are either:
>
> 2771 The bound or unbound object frame you triedto edit doesn't contain an
> OLE object.
>
> or
>
> 438 Object doesn't support this property or method.
>
>
> Please help me Master(s), so that I can justify my existance.[/color]
Tim Marshall
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Graph Chart using Access 2k3 with 2k format


Dave wrote:
[color=blue]
> I'm trying to follow the examples in VBAGRP9.CHM and/or VBAGR10.CHM with no
> success.[/color]

Dave, I'm sorry I'm not much of any help, but I did do a considerable
amount of graph manipulation in A97 quite some time ago and will be
doing so in the near future with A2003. Can you tell me where these
..chm files came from? I don't even know what .chm signifies.

Thanks in advance.

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Closed Thread