Obtaining the trendline equation

Vindicator

Registered User.
Local time
Today, 06:59
Joined
Apr 8, 2009
Messages
15
Hi There,
I am using MS Access. I am trying to obtain the value of the trendline equation from a chart. The chart is premade and on a split form. I have been trying to obtain the equation using VBA. The best way may be to use the MS Excel reference library or the graph library. Yet all my attempts have failed.


Thus far, the best examples i have found are like what follows:

Dim FevChart As Excel.Chart
Set FevChart = Me!NameofChart.Object

Or

Dim MyTrendline as Trendline
Set Trendline = ?????

I have also come across this coding on this forum, but I believe this pertains to excel not Access:

Function TrendFunction(yRange(), xRange(), xNew, tLine As Boolean)
Dim TrendArray

TrendArray = Excel.WorksheetFunction.Trend(yRange, xRange, xNew, tLine)
TrendFunction = TrendArray(1)
End Function
 
I have totally no idea how to specifically solve your problem, but wanted to give you some hints.

Pretty much anything you can do in Excel you can do from Access.

I have just finished working with some graphs in Access and the way that I taught myself most things was to open a test graph in excel and while making the changes I recorded a macro. I then looked at the properties or methods used and checked them in the Access object browser.

If all else fails here, in this forum, based on the fact that most things you can do in Excel you can do from Access I would suggest you search for an Excel specific solution first and then see what your options are for Access.
 
Thanks for the reply.

The last coding I had found(in my first post) was indeed code used in excel, I'm just not sure how to translate it to work in Access.
Thats a good suggestion recording actions in Excel using macros. I shall try it.
It might be easier for me to simply calculate the linear regression equation for the sets of data in my database in Access.
 

Users who are viewing this thread

Back
Top Bottom