473,386 Members | 1,821 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,386 software developers and data experts.

Access TREND calculation

I have a table with 12 records and the following fields: Month, InventoryUsage

I'm trying to calculate the linear TREND of the Inventory Usage data and I'd like to use a control on a form to show this data next to the Inventory Usage form.

Any ideas?
May 23 '07 #1
8 8388
puppydogbuddy
1,923 Expert 1GB
I have a table with 12 records and the following fields: Month, InventoryUsage

I'm trying to calculate the linear TREND of the Inventory Usage data and I'd like to use a control on a form to show this data next to the Inventory Usage form.

Any ideas?
Have you thought about using the MS Graph control to place a line graph on your form?
May 23 '07 #2
Have you thought about using the MS Graph control to place a line graph on your form?
Yes, that part was easy to figure out but it still doesn't give me a numerical representation of what I am looking for.
May 24 '07 #3
puppydogbuddy
1,923 Expert 1GB
Yes, that part was easy to figure out but it still doesn't give me a numerical representation of what I am looking for.
I not sure what you mean by it still doesn't give you a numerical presentation of what you are looking for? Please clarify. If you are referring to regression and other statisical functions available in Excel, those functions can be called from Access via automation techniques. See these links:

See these links for a "How To":


http://support.microsoft.com/kb/198571
http://www.fabalou.com/Access/Queri...l_functions.asp


See also:
http://www.cpearson.com/excel/ATP.htm
an add-in for scientific and engineering calculations
May 24 '07 #4
The links you provided were a great start to what I'm trying to do...let me explain further.

In Excel I could have a table as follows:
Month Usage Trend
1 55 56.29
2 57 56.77
3 56 57.26
4 62 57.74
5 59 58.23
6 56 58.71

The 3rd column (Trend) is calculated using the Trend function...quite easy in Excel! In Access, I used the link you provided (http://www.fabalou.com/Access/Querie..._functions.asp) and created a Function but I get a runtime error: Unable to get the Trend Property of the Worksheet Function Class. The reason I need to see these numbers is because we simply do not want to have to guess from a graph what the trend number is for any particular month.

Look forward to any other helpful ideas you may have.


[color=black][/color]

[color=black] [/color]

[color=black]I not sure what you mean by it still doesn't give you a numerical presentation of what you are looking for? Please clarify. If you are referring to regression and other statisical functions available in Excel, those functions can be called from Access via automation techniques. See these links:[/color]

[color=black] [/color]

See these links for a "How To":


[color=#800080]http://support.microsoft.com/kb/198571[/color]
[color=#800080]http://www.fabalou.com/Access/Queri...l_functions.asp[/color]



See also:
[color=#800080]http://www.cpearson.com/excel/ATP.htm[/color]
an add-in for scientific and engineering calculations[color=black][/color]
May 24 '07 #5
NeoPa
32,556 Expert Mod 16PB
Yes, that part was easy to figure out but it still doesn't give me a numerical representation of what I am looking for.
I'm sorry the answer doesn't seem to match your expectations.
For that though, you need to write the question more clearly and explicitly.
I'm sure you weren't trying to sound ungracious but please bear that in mind in future.

MODERATOR.

*edit*
Having seen your latest post - this seems redundant.
Keep it in mind though perhaps.
May 24 '07 #6
I figured out the problem so I thought I'd post the result in case it can be of help to someone in the future:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Function Trend()
  3. Dim objExcel As Excel.Application
  4. Dim Arg1(9) As Double
  5. Dim Arg2(9) As Double
  6. Dim x As Integer
  7. Dim result As Variant
  8.  
  9. For x = 0 To 9
  10. Arg1(x) = 10 + x
  11. Arg2(x) = x
  12. Next
  13. Set objExcel = CreateObject("Excel.Application")
  14. result = objExcel.WorksheetFunction.Trend(Arg1, Arg2)
  15. For x = 1 To 10
  16. MsgBox result(x)
  17. Next
  18. objExcel.Quit
  19. Set objExcel = Nothing
  20. End Function
  21.  
May 31 '07 #7
MMcCarthy
14,534 Expert Mod 8TB
Thank you for posting the solution.

You never know who might find it useful in the future.

Mary
Jun 1 '07 #8
NeoPa
32,556 Expert Mod 16PB
And, just in case you think I'm only here to be grumpy and criticise, let me add my thanks too.
It really is useful if solutions can be posted where found, even when they are not provided by our pool of Experts.

Cheers, -Adrian.
Jun 1 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Del | last post by:
Thanks in advance for any help. I have a database that was created in Access 2000. Several users have been upgraded to Access 2003. Since upgrading to 2003 we have noticed that one of the...
1
by: cdelaney | last post by:
I have a form that I created a calculation on using 2003. The calculation works exactly like I want it to but ONLY on the first and last record. The calculation does not work/exist on records in...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
14
by: Crimsonwingz | last post by:
Need to calculate a sum based on a number of factors over a period of years. I can use formula ^x for some of it, but need totals to carry over in the sum and have only been able to do this thus...
3
by: audleman | last post by:
I've been programming in Filemaker and am used to having a field type called Calculation. An example of a calculation: In a school registration database I have a date field corresponding to the...
5
by: kux | last post by:
Hello everyone, I hope someone is out here who can help me with a simple calculation... I have a sales data base in access with monthly sales history by product. to make future predictions I...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
13
by: Ulv | last post by:
I have a table (TblItems) with fields Lenght, Width and Height as decimalfields. I also have the fields Desc, a text field. In a form I have created this line of code after updating: Desc =...
8
by: elias.farah | last post by:
Hello Everyone, I'm having some very weird behavior on a couple of Access forms. (Not all forms, just some of them). The forms have been working for years, under Access XP/2003 etc, and last...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.