dynamically update time fields

I’m trying to dynamically update the “TIME” fields of a form from the onLoad event.

The format is hhmm.
I have tried all the following…


{field_name} = '00:00';

AND

{field_name} = '00:00:00';

AND

{field_name} = '0000';

AMD

{field_name} = '000000';

All I get in the fields is “HH:II”.

Anyone know how to do this or why SC won’t accept my dynamic inputs?

Dave

Re: dynamically update time fields

With date/time fields, I believe will have to wrap the value in double quotes as well.

The other option is to issue an SQL to UPDATE the field in the event.

Regards,
Scott.

Re: dynamically update time fields

That’s what I’m doing, pulling the info from the DB and manipulating it into the correct string HH:ii for the time field but no luck.

Very odd since it works fine with grids.

D

Re: dynamically update time fields

Have you looked at the generated code to see how SC is trying to insert the time string?

Regards,
Scott.

Re: dynamically update time fields

Update:

Well, I figured out a way to trick SC into letting me do it…

  1. I set all my db fields to time, then synchronized the form with the table.
  2. Then I set all the db fields back to INT.
  3. Then I used the code below and it worked perfectly:

{field_name} = '00:00';

SC won’t accept the dynamic input unless the field’s SQL Type is TIME, if you are using a TIME data type.

Hope this helps anyone else with the same issue.

D.