Set Trendline color

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have the following code that adds a trend line to my chart. I want the
color of the trendline to be red. It's default is black. How can I set the
color to RED? I know I can do it manually by clicking on the trendline and
changing the color. I want to do it in code.

Dim GraphObj As Object
Set GraphObj = Me![OLEUnbound0].Object.Application.Chart
GraphObj.SeriesCollection(1).Trendlines.Add
 
R

RonaldoOneNil

Dim GraphObj As Object
Set GraphObj = Me![OLEUnbound0].Object.Application.Chart
GraphObj.SeriesCollection(1).Trendlines.Add
GraphObj.SeriesCollection(1).Trendlines(1).Border.ColorIndex = 3
 
M

mattc66 via AccessMonster.com

That worked - thanks. Where could i find the code options for doing this?
Dim GraphObj As Object
Set GraphObj = Me![OLEUnbound0].Object.Application.Chart
GraphObj.SeriesCollection(1).Trendlines.Add
GraphObj.SeriesCollection(1).Trendlines(1).Border.ColorIndex = 3
I have the following code that adds a trend line to my chart. I want the
color of the trendline to be red. It's default is black. How can I set the
[quoted text clipped - 4 lines]
Set GraphObj = Me![OLEUnbound0].Object.Application.Chart
GraphObj.SeriesCollection(1).Trendlines.Add
 
R

RonaldoOneNil

In the on-line help. I just highlighted the word Trendlines and pressed F1. I
then looked at the properties and methods that are available to the
Trendlines Object and tried the ones that I thought would work.

mattc66 via AccessMonster.com said:
That worked - thanks. Where could i find the code options for doing this?
Dim GraphObj As Object
Set GraphObj = Me![OLEUnbound0].Object.Application.Chart
GraphObj.SeriesCollection(1).Trendlines.Add
GraphObj.SeriesCollection(1).Trendlines(1).Border.ColorIndex = 3
I have the following code that adds a trend line to my chart. I want the
color of the trendline to be red. It's default is black. How can I set the
[quoted text clipped - 4 lines]
Set GraphObj = Me![OLEUnbound0].Object.Application.Chart
GraphObj.SeriesCollection(1).Trendlines.Add
 
M

mattc66 via AccessMonster.com

I did that and I get "Keyword Not Found". Thanks again for your help.
In the on-line help. I just highlighted the word Trendlines and pressed F1. I
then looked at the properties and methods that are available to the
Trendlines Object and tried the ones that I thought would work.
That worked - thanks. Where could i find the code options for doing this?
[quoted text clipped - 8 lines]
Set GraphObj = Me![OLEUnbound0].Object.Application.Chart
GraphObj.SeriesCollection(1).Trendlines.Add
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top