EditMode Property

Object List Next Object

Defined By:
Recordset

Description:

Indicates the edit status of the CurrentRecord.

Settings:


Setting Description


0 - EditNone No edits are currently in progress.

  1. - EditMode An edit is in progress, meaning that the Edit method has been invoked and the record being edited is in the copy buffer

  2. - EditAdd AddNew method has been invoked and the copy buffer currently contains a new record that has not been saved.

Details:

Use this property when you want to use something other than the RecordSet's default functionality. For example, you can check the value of this property in conjunction with other properties to determine whether or not to update your records. You would typically use this property in the Validate event. The following example prevents the user from changing an existing ID field by checking to see whether the EditMode is editing the CurrentRecord.

Sub Validate(state as Long, save as Long)

If TextBox1.DataChanged Then

If RecordSet.EditMode = "Modify" Then

InfoBox.Message("Warning", "ID can only be set when adding")

TextBox1.DataChanged = False

End If

End If

End Sub

Data Type: (ReadOnly)