T
Tom
I need to create a function that will allow me to use a "Running Sum" in a
query without being dependent on a unique ID.
I came across the article below, but I don't get it to work properly.
http://www.tek-tips.com/faqs.cfm?fid=5268
Could someone please provide me additional pointers to get this to work:
Let's say I have the following values:
TableName: "SomeTable"
FieldName: "BudgetAmount"
(plus other field names e.g. "Priority")
Basically, the query contains 2 fields:
- Priority
- BudgetAmount
Sample Data in Query -- 1st Execution
=====================================
Priority BudgetAmount ExpressionShowingResultsBasedofModule
-------- ------------ -------------------------------------
1 75.00 75.00
2 100.00 175.00
3 50.00 225.00
Sample Data in Query -- 2nd Execution (Priority has changed!)
=====================================
Priority BudgetAmount ExpressionShowingResultsBasedofModule
-------- ------------ -------------------------------------
1 50.00 50.00
2 100.00 150.00
3 75.00 225.00
Here are my questions (based on the info presented in the URL:
http://www.tek-tips.com/faqs.cfm?fid=5268
1. "Next . . . . add the following code to the same module (this is the
global running sum routine):"... is this something I should be aware of...
of do I just open a new module and simply paste the code in it (with
appropriate adjustments)?
2. Do I call my query "qryTest"?
3. '**********************************************
'* idName - Unique field name. *
'* idValue - Value of unique field. *
'* sumField - The name of the field to runsum *
'**********************************************
a. Do I need a unique field e.g. "idName"?
b. What is the "idValue"? How does it relate to "idName"?
c. Must I change "sumField" to "BudgetAmount"?
4. "Double ... RunSum: CDbl(qryRunSum("SumID",[SumID],"curSum"))"
a. Do I just replace "ExpressionShowingResultsBasedofModule" with the
statement above?
b. Do I need to make adjustments to the statement above? E.g. replace
"SumID" with something else? If yes, what's
the value based on my sample data listed previously?
Again, I would really appreciate any help with this? Pls bear in mind that
I haven't used modules before.
Thousand thanks!!!
Tom
query without being dependent on a unique ID.
I came across the article below, but I don't get it to work properly.
http://www.tek-tips.com/faqs.cfm?fid=5268
Could someone please provide me additional pointers to get this to work:
Let's say I have the following values:
TableName: "SomeTable"
FieldName: "BudgetAmount"
(plus other field names e.g. "Priority")
Basically, the query contains 2 fields:
- Priority
- BudgetAmount
Sample Data in Query -- 1st Execution
=====================================
Priority BudgetAmount ExpressionShowingResultsBasedofModule
-------- ------------ -------------------------------------
1 75.00 75.00
2 100.00 175.00
3 50.00 225.00
Sample Data in Query -- 2nd Execution (Priority has changed!)
=====================================
Priority BudgetAmount ExpressionShowingResultsBasedofModule
-------- ------------ -------------------------------------
1 50.00 50.00
2 100.00 150.00
3 75.00 225.00
Here are my questions (based on the info presented in the URL:
http://www.tek-tips.com/faqs.cfm?fid=5268
1. "Next . . . . add the following code to the same module (this is the
global running sum routine):"... is this something I should be aware of...
of do I just open a new module and simply paste the code in it (with
appropriate adjustments)?
2. Do I call my query "qryTest"?
3. '**********************************************
'* idName - Unique field name. *
'* idValue - Value of unique field. *
'* sumField - The name of the field to runsum *
'**********************************************
a. Do I need a unique field e.g. "idName"?
b. What is the "idValue"? How does it relate to "idName"?
c. Must I change "sumField" to "BudgetAmount"?
4. "Double ... RunSum: CDbl(qryRunSum("SumID",[SumID],"curSum"))"
a. Do I just replace "ExpressionShowingResultsBasedofModule" with the
statement above?
b. Do I need to make adjustments to the statement above? E.g. replace
"SumID" with something else? If yes, what's
the value based on my sample data listed previously?
Again, I would really appreciate any help with this? Pls bear in mind that
I haven't used modules before.
Thousand thanks!!!
Tom