I am almost afraid to ask this question because I think I am likely to get a response that says "you are not supposed to calculate a stored value." I know you're not supposed to most of the time, but there are exceptions.
Sometimes I allow the owner of an applicaiton to do some things interactively with Access. This allows them to do a number of ad-hoc queries (and potentially reports) on their own. However, writing SQL code that does multiplications is generally just a little to much for them to grasp. They like it better when they can just select field names and let Access do all the work for them.
I have three controls on a form that constitute a calculation. The multiplying of these these 3 controls is what constitutes the value that should be placed into a real field. One of those controls (that are part of the calculation) is itself a calculated control. If this were not the case, (ie, that one of the fields is already a control that contains a calculation) there wouldn't be a problem. I guess the question is, How do I get the result of controlA (that contains real data) times controlB (that contains real data) times control C (which is itself a calculated field) into a real control called txtSalesCommission?
My first thought was to put an unbound, hidden control on the form that contains an expression that produces the result I'm looking for. Then, when the value in that control changes, fetch its value (like in the afterupdate event of that control) and put it in the real control (txtSalesCommission). The theory is good but the reality seems to be that no events are triggered in a calculated field (like afterUpdate). Perhaps there is another, better way.
Start Free Trial