开发者

Access bound textfield's AfterUpdate and Change events not firing

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜