So - - - - @Zvoni, you are saying that the behaviour is exactly as expected (and documented) - and pressing [Enter] (Return) does NOT signal that Editing is Done ?
My feeble brain tells me that when I hit [Return] and I see (in Debug mode) that the OnEditingDone Event IS activated that indicated otherwise. I can now also appreciate that changing the Focus to another field would also call OnEditingDone perfectly reasonably.
I suspect that OnEditingDone is not the best Event to use in this case so it may well be better to use OnKeyUp and trap for Key = #13.
Can you (or anyone) see any negative impact on that option ?
as a first: I would never use Enter/Return to trigger an OnEditingDone or any other Event specific to a Data-Entry-control.
The simple reason is, that i usually have a Button, which i declare as "Default" for the Form (e.g. "I'm done. Save it to Database" or similar).
Next: the proposed Way with the "Modified"-Property would actually be the preferable way.
Though what i could see:
You're setting "Done"/"Modified" at the Beginning of your Code!!! Somewhere around Line 3 of your Procedure
But later on you do a "DoB.Caption:=something" --> You're changing the Control again!
"Modified:=False" should be the last instruction before exiting the Function.
You hit Enter/Return
Your validation-Code in OnEditingDone executes
First Line checks if not Modified then Exit --> Since you actually modified the Control, this returns True, and code continues
As the last instruction you set Modified to False
You jump to the next control (which you actually do from Code!!!!)
OnEditingDone gets triggered again, but breaks out in the first line, since Modified is False