Avatar

Level 10

Hi,

the fourth line in your code is nonsense.

How the value of DateTimeField1 should be formatted?

You need a function such as Time2Num to convert the date into an integer.

var vcurrent =  Time2Num(form1.ActionsHeaderFrame.DateTimeField1.formattedValue, "HH:MM") // this is the current time field

Also, the sixth line is incorrect.
The if expression need surrounding brackets () and an operator like == or eq to check the values.
if (vcurrent == Num2Time(vFinish, "HH:MM")) then