Thanks for the help...that was exactly what I needed!
-Matt
User Profile
Collapse
-
Call a Function in MS Access
I've setup a command button with a Click event procedure that call a function:
Call GetTrend([UsageMonth]).
I'd like to move the command button to the parent form but when I do this I get an error...Can't find field '|' referred to in your expression.
Any help is appreciated.
Matt -
The query does work outside the code so I decided to try to put the query SQL statement in my function instead and was able to get it to work that way. Tks....Leave a comment:
-
-
The form is open...I also tried changing the . to a ! but it still throws a run-time error "Item not found in this collection"....Leave a comment:
-
Access Set DAO Recordset
I've written a function which uses a DAO Recordset. The following statement sets the recordset:
Set rs = db.OpenRecordse t("qryLast24Mon ths")
My dilemma is that when my query has a criteria set as follows: [forms]![frmModels].[ModelNum], the function will not work due to a syntax error. However, if I set the criteria to an actual modelnum such as 7300, the function works just fine.
Any help or ideas... -
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:
[CODE=vb]
Function Trend()
Dim objExcel As Excel.Applicati on
Dim Arg1(9) As Double
Dim Arg2(9) As Double
Dim x As Integer
Dim result As Variant
For x = 0 To 9
Arg1(x) = 10 + x
Arg2(x) = x
Next
Set objExcel = CreateObject("E xcel.Applicatio n")
...Leave a comment:
-
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...quit e easy in Excel! In Access, I used the link you provided (http://www.fabalou.com/A...Leave a comment:
-
Yes, that part was easy to figure out but it still doesn't give me a numerical representation of what I am looking for....Leave a comment:
-
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?
No activity results to display
Show More
Leave a comment: