sum on form

amna77

Active Member
Joined
May 9, 2002
Messages
251
hi on my form i am tying to get total, like total defects, by doing =Sum(([TBlush])+([TBurn])+([TContanmination])). i does calculate sum, but it does not show changes right away, i tried to put requery macro on after update event of thos three fields, so when ever i enter any number it shoud update my total defects right away, but it does not. it does update when i move back and forth in my records.
anyidea why i am not getting update defects right away? what should i do?
tahnks in advance
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

do you change the values of the three fields on the formular?

If yes, than you only need a little VB-Script .

Private Sub TBlush_KeyUp(KeyCode As Integer, Shift As Integer)

Me.[ControlwithSUM].value=Sum(([TBlush])+([TBurn])+([TContanmination]))

End Sub


and then repeat this for the 2 other fields.
 
Upvote 0
thanks for reply, but it is keep giving me error that sub or function not defined, any idea what i am doing wrong. i have the same codes as you said.

thanks
 
Upvote 0
Hi
the problem you have described is quite normal. Access can't recalculate the total until the record has been saved. I'm no good with VB but one of the VB experts might help with a routine to force the reocrd to be saved after any one of the three fields in question has been updated.
Andrew :)
 
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top