I have two time field Time and Time2 in my form,both field type are Date/Time.Now i enter time in fiest field and second field manually by using field style- Notes style.Then i want to difference of both time and want to store it to another field-Total automatically.
If someone have any idea,Kindly tell me.
Thank you
Subject: time difference
Your Total field just needs to be Field1-Field2.
This will give you a difference in seconds, so divide by what you want to display days/minutes/hours. Of course you need to check for error first:
tmp:=Field1-Field2; @if(@iserror(tmp);“Dates aren’t right”;tmp)
The other problem you have is refreshing the field I guess (maybe that’s your only problem and what’s above is obvious but you don’t say).
To do this, I would change your fields to calendar/time controls. People can still enter the dates manually if they want. Then check the ‘Run Exiting/OnChange events on value change’ checkbox in the field properties and enter the following code in the Exiting event:
dim w as new notesuiworkspace
dim uidoc as notesuidocument
set uidoc = w.currentdocument
call uidoc.refresh
That should work