I want to prevent the form from being closed if the value in a calculated field is not zero
I have a form that is used to enter historical data into a table from paper copies of our Sales Slips
I have set up two calculated fields on that form that shows the variance between what the form has calculated and what the user has entered. I want the variance to be zero in both fields before I allow the form to be closed and the record saved.
I have looked at form properties and form control properties but cannot find a way to verify the calculated field is zero before closing the form. I am now thinking I need to use a script. But I do not know how to do that. Do I need to use a script to do what I want or is there a way to do this from the Action Script menues?
If I do need to create a script where do I start? I want the script to do this:
Check the values in the two calculated fields on the form
If the value in both fields is zero than allow the user to proceed as normal (close form)
If the value is not zero in either field than display an error message and put the user back into the form to make corrections until the values are zero.
Do I put this script on the "OnExit" event? or the "CanExit" event? or somewhere else?
I've never done scripting in A5 before.
Thank you,
Sean
I have a form that is used to enter historical data into a table from paper copies of our Sales Slips
I have set up two calculated fields on that form that shows the variance between what the form has calculated and what the user has entered. I want the variance to be zero in both fields before I allow the form to be closed and the record saved.
I have looked at form properties and form control properties but cannot find a way to verify the calculated field is zero before closing the form. I am now thinking I need to use a script. But I do not know how to do that. Do I need to use a script to do what I want or is there a way to do this from the Action Script menues?
If I do need to create a script where do I start? I want the script to do this:
Check the values in the two calculated fields on the form
If the value in both fields is zero than allow the user to proceed as normal (close form)
If the value is not zero in either field than display an error message and put the user back into the form to make corrections until the values are zero.
Do I put this script on the "OnExit" event? or the "CanExit" event? or somewhere else?
I've never done scripting in A5 before.
Thank you,
Sean
Comment