It sounds like your calculation that subtracts the time values should be in a field of type calculation instead of an auto-entered calculation. With the field of type calculation, the field contents of that field cannot be edited.
That helped for the third field, thanks Phil.
But I still have the problem that the first two fields can by modified by accidentally clicking on it. If the script trigger is "On object entry", which I would like not to change. There I can't use the type calculation since these have a script trigger "On object entry" to get the current time. Unless there is a formula to get the current time by clicking the field which I can enter as a calculation?
Also to see the correct calculation I always have to click in the third field. Because it firsts calculates a minus value as the first field is always clicked on before the second field. Which means that when the first field gets the current time the second field is still on 00:00:00 and a minus value is calculated. Isn't it possible that the calculation is only done after in both fields the time is entered (via clicking in the field)?
How would we tell the difference between clicking the field accidentally or on purpose?
Since the user's interaction with the layout is identical in either case and FileMaker can't read the user's mind, I can't see any design change that can be made that allows the user to click the field deliberately and prevents the user from clicking it accidentally.
You could modify the script, however, to show a confirmation message such as "do you want to enter the current time?" and then only do so if the user selects yes or your script could avoid entering the time if a value is already entered in the field...
Sorry, I should have been more precise.
Normally the first current time, which is entered is the correct one. So what I would like to prevent is that accidentally someone enters the current time in the field again. But it would also be good, if one can change the "current time", just in case. Because in this table minutes and seconds do matter in these fields.
Therefore is it possible to combine your two options you described, i.e. having a script, which asks for a conformation if you want to enter the time in a field, where a value is already entered in it? So, the first time you enter the current time in the field, the script is not activated but the second time and thereafter it is. I guess a script trigger "on object modifiy"? But I'm already using the option "on object enter" to get the current time. Is it possible to have two script triggers in one field?
You could set up the OnObjectEnter trigger to perform a script to enter the current time if the field is empty and do nothing if it is not:
If [ IsEmpty ( YourTable::TimeField ) ]
Set Field [YourTable::TImeField ; Get ( CurrentTime ) ]
That worked perfect.
Thanks again for your help, Phil! :)