When is a Form Record Edited?

I have a form on which I have a checkbox - un-enabled (and set to not-editable).

The form has a button which runs a sql routine, and at the end of it set’s the checkbox to 1 - this indicates the sql was completed without error. Works well.

When the record is edited (and fired on ‘onRecordEditStop’) I set the the checkbox to 0.

Problem is - even just clicking into the fields on the form (without touching / changing any data, and then clicking the background) unchecks the checkbox - so indicating that the record has been edited???

Edited: Just realised that this checkbox loses its setting even when clicking out of the form on white space? Gota be something other than record edit?

I moved the checkbox setting to the onDataChange for the various elemnts on the form - but this seems like it should work on the form parameter too!

I thought the onRecordEditStop should only be fired if the record was dirty?

What am I missing here? Appreciate feedback.