Don’t get mad. Just trying to formulate the cause of action.
If the OnExit occurs, the user has been in the control. Therefore it stands to reason to check the fields validity then. Even if modified is False.
Changing Modified to True when a new record is inserted is definitely wrong. Records may stem from different sources. The values of the fields may be well be beyond their min/max values.
For instance, the program may show the user a list of records where the values are wrong, with the purpose of letting him change the values to valid ones. Therefore the situation in the attached GIF should not be possible: the first time the user entered a wrong value, he got an error message. Then just Tabbing outside the TsDBCalcEdit control with the wrong value was possible. Why was this possible? Because the user did not modify anything, so Modified was False. That situation should not be possible. So, I suggested to check the min/max values in an overridden DoExit procedure.
Attachments:
You must be
logged in to view attached files.