Expand my Community achievements bar.

Timesheet form calculation problem

Avatar

Level 1

I am having a recalculation problem on my timesheet form. In a column there are three sets of in and out times, with a subtotal formatted in hours. The subtotal may subtract a number from a field below itself as well if there is an amount in that field. The occuring problem is that when a user deletes time from the in out fields (due to a mistake on their part), the subtotal amount does not calculate back to nothing (in the case of deleting all the in out times). The time gets stuck in the field. Is there a way to fix this problem?

Here's my code:

Thank you for any help!

form1.#subform[0].Body.RegHrTot1[0]::calculate - (FormCalc, client)
var in1  = Time2Num(in1Sun1.formattedValue,"h:MM A")
var out1 = Time2Num(out1Sun1.formattedValue,"h:MM A")
var in2  = Time2Num(in2Sun1.formattedValue,"h:MM A")
var out2 = Time2Num(out2Sun1.formattedValue,"h:MM A")
var in3  = Time2Num(in3Sun1.formattedValue,"h:MM A")
var out3 = Time2Num(out3Sun1.formattedValue,"h:MM A")


if ((in1 > 0) and (out1 > 0) or (in2 > 0) and (out2 > 0) or (in3 > 0) and (out3 > 0)) then                                                          
$ = (((out1-in1)+(out2-in2)+(out3-in3)) / (60 * 60 * 1000))
 
endif

Sum($-act4Sun1)

1 Reply

Avatar

Former Community Member

Is your  form generating any errors?

If not send the form and a description of the issue to LiveCycle8@gmail.com and I will have a look when I get a chance.

paul