How to Fire VBA Code when a Calculated Textbox Changes Its Value

whdyck

Registered User.
Local time
Yesterday, 18:41
Joined
Aug 8, 2011
Messages
169
I'm using MS Access 2003.

I have a textbox control txtAmountOutstanding whose Control Source is as follows:
=[txtActualAmount]-[txtAmountSettled]

(txtAmountSettled is itself calculated from data in a subform).

I'd like to be able to programmatically insert a Settled Date into another field on the form whenever the value for txtAmountOutstanding first becomes zero.

I tried to do this by entering some code in the On Change event for txtAmountOutstanding, but apparently this event does not fire as a calculated field. Is there a way to do this?

Thanks for any help you can give.

Wayne
 
You can put the code in the after update event of the two controls the calculation depends on. Hint, rather than test the value of the calculated control, I'd test the source controls. Sometimes there's a lag in the calculation. I'd probably create a function and call it from those two events.
 

Users who are viewing this thread

Back
Top Bottom