Reference > TDBTime Control > TDBTime Control Events > InvalidValue Event (TDBTime) |
InvalidValue Event (TDBTime)
The InvalidValue event occurs if the user tries to move the focus away from the control, when the entered value is invalid; it cannot be converted and recognized as a valid value.
control_InvalidValue (Restore As Boolean)
restore is a Boolean value that determines whether to restore the value when moving the focus away from the control.
The possible values for restore are as follows:
True - Restores the old valid value. (Default)
False - Clears the content in the control.
If the restore argument is set to True (default), the underlying value will be restored to the old value which when the control received the focus. If set to False, the control will be cleared, setting its value to Null. However, if the focus is set back to control, the restore argument will be ignored, and the control will display the invalid value just as it was with its old selection setting. If you want to modify the underlying value, you must set the Value, Number, or Text property.
When modifying date values by changing the Value, Number, or the Text property with an invalid value, this will cause an invalid value error to occur. No events are fired in this case.
When binding the control to a data source, if the retrieved value is an invalid value, the DBError event will fire, returning an error code - 0.
See Also