469,273 Members | 1,802 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,273 developers. It's quick & easy.

how to use access to continually update and calculate

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
5 2006
missinglinq
3,532 Expert 2GB
What expression are you using to calculate the grand total and where does it reside?
Jul 20 '07 #2
Wiley
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
Wiley
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
3,532 Expert 2GB
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
Wiley
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.

Similar topics

3 posts views Thread by Lapchien | last post: by
3 posts views Thread by Iain Miller | last post: by
2 posts views Thread by Stan Smith | last post: by
4 posts views Thread by alexandre.brisebois | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.