473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I refer to a series on an MSgraph in access?

I have an msgraph on a form. The chart has five series on it. On the
same form I have five checkboxes. I'm trying to make it so that
checking/unchecking a checkbox will result in each of the series on the
chart being shown/hidden. I keep getting "object does not support
method" error.

I'm trying code like:

Set cht = Me.scoreHandicapChart.object.seriescollection(1)
cht.series.showline = false

I've done this in Excel, but why doesn't Access work the same way?

Thanks

Nov 13 '05 #1
1 5379
In case anyone else is having a problem like this, I figured out that I
needed to add the MS graph reference (done from VB->Tools menu) and
then used the following code:

Function showOrHideChartLines(tickbox As Boolean, seriesIndex As
Integer,_ colorNumber As Integer)

Dim cht As Graph.Chart

Set cht = Me.Chart1.Object

If tickbox = False Then
cht.SeriesCollection(seriesIndex).Border.ColorInde x =
xlColorIndexNone
cht.SeriesCollection(seriesIndex).MarkerStyle =
xlMarkerStyleNone
If seriesIndex = 1 Then
cht.SeriesCollection(seriesIndex).Trendlines(1).De lete
End If
Else
cht.SeriesCollection(seriesIndex).Border.ColorInde x =
colorNumber
cht.SeriesCollection(seriesIndex).Border.Weight = xlMedium
cht.SeriesCollection(seriesIndex).MarkerStyle =
xlMarkerStylePlus
cht.SeriesCollection(seriesIndex).MarkerForeground ColorIndex =
colorNumber
cht.SeriesCollection(seriesIndex).MarkerBackground ColorIndex =
xlColorIndexNone
If seriesIndex = 1 Then
cht.SeriesCollection(seriesIndex).Trendlines.Add
cht.SeriesCollection(seriesIndex).Trendlines(1).Ty pe =
xlPolynomial
cht.SeriesCollection(seriesIndex).Trendlines(1).Or der = 4

cht.SeriesCollection(seriesIndex).Trendlines(1).Bo rder.ColorIndex = 8
End If
End If
end function

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anthony Cuttitta Jr. | last post by:
We have an application that outputs several different graphs from data downloaded from our AS400. The application has worked without (this) issue for several months now, but just recently, the...
1
by: Andre Kristoffersen | last post by:
Hi! I have found the MSGraph object very easy to use in Access if you use it in a straightforward manner. Just by changing the object rowsource ( I use sql), the graph changes accordingly. ...
6
by: Scott | last post by:
I have a unbound MS graph object built as a pie chart that I set to a value list and I am updating programatically. Everything works except that the graph does not repaint except for when the...
2
by: cmhoz | last post by:
Hello... I have a form (main form) with a tabcontrol that houses a series of subforms. What I'm trying to do: When I tick a box on "subform 1" (it has spaces in its name) I need controls on...
5
by: grant | last post by:
I'm trying to use a scatter chart to plot level reading for a pump station level sensor. The sensor takes a reading every 4 seconds, and there are 23,000 reading per chart There appears to be...
0
by: blurbology | last post by:
I have a word document that contains a Graph (MSGraph). I am trying to update the Chart's datasheet with new values, but I cannot seem to get the correct reference for the chart object. What I am...
0
by: G Gerard | last post by:
Hello I have a graph in a report that is has the following properties: OLE Class - Microsoft Graph 2000 Chart Class - MSGraph.Chart.8 On some computers this graph does not work. I suspect...
4
by: keirnus | last post by:
Hello, I've been coding in Access VBA to create an Excel Graph and it was good. Until I got this error: Please check the code below: Private Sub TestGraph3()
2
by: LucasLondon | last post by:
Hi, I'm trying to use VBA to extract underlying data from charts in powerpoint to excel, i.e from the underlying powerpoint datasheet that feeds the chart. I've found the macro below on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.