By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,494 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

how to use access to continually update and calculate

P: 5
I have created a form that contains 1000s of items, though I have an expression that have calculated the grand total. If I make any changes to my quantities the grand total does not change. Hence how do I use access to continually update and calculate the grand total in a form after each new entry.
Jul 20 '07 #1
Share this Question
Share on Google+
5 Replies


missinglinq
Expert 2.5K+
P: 3,532
What expression are you using to calculate the grand total and where does it reside?
Jul 20 '07 #2

P: 5
I have created a form that contains 1000s of items, though I have an expression that have calculated the grand total. If I make any changes to my quantities the grand total does not change. Hence how do I use access to continually update and calculate the grand total in a form after each new entry.
The expressions I tried in my form I were QTY=SUM[STOCKIN]-[STOCKOUT], TOTAL=SUM[QTY]*[UNITPRICE] then for the grand total I tried =SUM[TOTAL], DSum("[QTY] * [UNIT PRICE]", "TOTAL') even DSum("[QTY] * [UNIT PRICE]", "Consumables'')but nothing seems to work.
Jul 23 '07 #3

P: 5
What expression are you using to calculate the grand total and where does it reside?
Oopps I think previously I replied to myself :
The expressions I tried in my form I were QTY=SUM[STOCKIN]-[STOCKOUT], TOTAL=SUM[QTY]*[UNITPRICE] then for the grand total I tried =SUM[TOTAL], DSum("[QTY] * [UNIT PRICE]", "TOTAL') even DSum("[QTY] * [UNIT PRICE]", "Consumables'')but nothing seems to work.
Jul 23 '07 #4

missinglinq
Expert 2.5K+
P: 3,532
Assuming that your expressions are correct (only you know exactly what you're trying to do) in order to have it update when you change something, you need to recalculate your totals for the form each time you change the value of any of the fields that are involved in the calculations.

Expand|Select|Wrap|Line Numbers
  1. Sub YourControlName_AfterUpdate()
  2.  Me.Recalc
  3. End Sub
Linq ;0)>
Jul 23 '07 #5

P: 5
Assuming that your expressions are correct (only you know exactly what you're trying to do) in order to have it update when you change something, you need to recalculate your totals for the form each time you change the value of any of the fields that are involved in the calculations.

Expand|Select|Wrap|Line Numbers
  1. Sub YourControlName_AfterUpdate()
  2.  Me.Recalc
  3. End Sub
Linq ;0)>
Thanks missingling,
But still its not working I do not know what I did wrong, because I added the grand total text box under my totals. Maybe if I let you know what I did at first.
1. Qty the expression is [STOCKIN]-[STOCKOUT (this is how this is calculated)
2. Totals " [QTY]*[UNITPRICE] "
3. GRAND TOTAL, I used =Sum([TOTAL]) this calculates my total yes but does not update after changes. I have tried a combination of expressions and still nothing and I got Error! and Name?
should it be a problem using a calculated field to calculate another, is there ?
Jul 24 '07 #6

Post your reply

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