CodeCharge Studio
EditMode Run-Time Property (ASP)
Applies to
Record Form,
EditableGrid Form
Type
Boolean
Access
read-only
Syntax
object.EditMode
Description
This property determines whether given record form is currently in edit or insert mode. In edit mode all data source parameters need to have values assigned (including row identifier). In insert mode some data items may be empty.
See also
Errors property
Example
The following code (placed in the OnValidate event procedure ) checks the state of the modified_by
form field and generates an error message if the field is empty. Thanks to the EditMode property, custom verification takes place only if the record is updated (not inserted).
Function articles_OnValidate()
If articles.EditMode and IsEmpty(articles.modified_by.Value) Then
articles.Errors.AddError("The modified_by field cannot be empty when updating.")
End if
End Function
On-line, printable versions and updates