How did you set this up in Manage | Database | Fields?
Is the first calculation set up on a field of type number with the expression specified as an auto-enter calculation? Could "field3" be from a related table? Or could the "do not replace existing value..." check box be selectged? If so, the value returned will not update when field3 is modified.
First of all, thanks for replying.
My field3 is the calculation result from other fields that are specified as auto-enter calculation.
Any sugestion to get my calculation work?
Could you please sugest a solution for my calculation, but without the use of scripts?
Make it a field of type calculation instead of a number field with an auto-entered calculation. If you change the field type, your calculeted expression will not be lost.
If I do that, the field won't be modifiable. And I need it modifiably.
Is there a way to create a calculated field to take the value of my field and use it in my division?
What you asks seems a touch contradictory: You want the field to update automatically when field3 is modified but you also want to directly edit they value in this field. What should happen to the value in this field if you edit it and then the value in field3 changes?
It may help to take a step back from the mechanics involved and describe the actual field and how you need to use it.
WIthout going there, you have two options: An update script--which you have already rejected or two fields in place of one. FIeld 1 would be the above field redefined as a calculation field and modififed to also refer to an Override field:
If ( Isempty ( OverrideField ) ; field2 / field3 ; OverrideField )
On your layout, you then place your Overrirde Field, with a transparent fill color, on top of your current field. When you click or tab into the Override field, you can enter a specific value. If you do not enter a value, the calculation is visible. Use conditional formatting to make the calculation field invisible when there is data in the Override field.
Now I see it clear... Thanks. But just in case.. could you please guide me in update script option?? (sorry)
If you have two tables linked like this:
TableA::__pkTableAID = TableB::_fkTableAID
For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained
And Field3 is defined in TableA while the field with auto-entered calculation resides in TableB....
A script similar to this might be set up with the onObjectSave trigger on Field3 on the layout where users are allowed to edit the value:
If [ TableB::_fkTableAID // true only if related records exist in TableB ]
Go To Related Record [Show only related records; From table: TableB; Using layout: "TableB" (TableB) ]
Replace Field Contents [no dialog; TableB::Field1 ; TableB::field2 / TableB::field3 ]
Go To Layout [original layout]