gplatek
Posts: 2
|
| Posted: 05/05/2005, 2:45 PM |
|
I have a timestamp textbox in an editable record form with a default value of CurrentDateTime which works very nice when adding a new record, but not when editing an existing record. My goal here is to be able to see when a record was last changed. This only works for when a new record is created though. If I edit an existing record, I just see the original DateTime stamp in the textbox. Obviously it is just reading this from the database and ignoring the default value. How can I force the default value to populate the field every time? I originally tried using the MySQL "timestamp" data type but that looks horrible: 20050505164401. Thats May 5, 2005 4:44:01PM. ugly!
_________________
-Greg |
 |
 |
Nicole
Posts: 586
|
| Posted: 05/06/2005, 1:42 AM |
|
Greg,
A value from Default Value property is really applied only in insert mode. In Edit mode you need to create Before Build Update event and assign a default value there
$form_name->ds->date_field->SetValue(CCParseDate(date("y-m-d"), Array("yy", "-", "mm", "-", "dd")));
BTW, you can use Hidden control instead of textbox and hide date value. Or select display date format in Format property to output formatted date value.
_________________
Regards,
Nicole |
 |
 |
|