tags:

views:

15

answers:

1

I have a simple form in Access. There are number of textfields. There is also one textfield on the form with the "Control Source" set to be sum of all the other fields on the form. So basically as a user modifies data on other fields, this "total sum" field gets updated automatically. This works fine.

What I would like to do now is, when this "total sum" field changes, perform other actions via VBA. I though I could achieve this using the textfield's AfterUpdate and Change events. However they are not firing at all. Could it be because this filed is not in focus and not being updated manually? How can I detect changes?

Are you able to help?

Thanks

+1  A: 

Write a function like

Private Function ComputeSum() as Double
   ' do your stuff

   ComputeSum = 0
End Function

and include it in the control source property, like =Control1+Control2+ComputeSum().

This function gets called every time the sum changes.

dwo