>
Value | Description |
dbEditNone | No editing operation is in progress. |
dbEditInProgress | Edit method has been invoked, and the current record is in the copy buffer. |
dbEditAdd | AddNew method has been invoked, and the current record in the copy buffer is a new record that hasn't been saved in the database. |
Function PostChange(rstTarget as Recordset) As Integer If (rstTarget.EditMode = dbEditAdd) or _ (rstTarget.EditMode = dbEditInProgress) Then rstTarget.Update PostChange = True Else PostChange = False End If End FunctionExample (Microsoft Excel) This example checks to see whether the Customer recordset in the NWINDEX.MDB database can be edited. If so, the example updates the value of the first field of the first record with the value in cell C3 on Sheet1. To create the NWINDEX.MDB database, run the Microsoft Excel example for the CreateDatabase method.
Dim db As Database, rs As Recordset Set db = Workspaces(0).OpenDatabase(Application.Path & "\NWINDEX.MDB") Set rs = db.OpenRecordset("Customer") If Not ((rs.EditMode = dbEditAdd) Or _ (rs.EditMode = dbEditInProgress)) Then rs.Edit rs.Fields(0).Value = Worksheets(1).Cells(3, 3).Value rs.Update Else MsgBox ("Cannot update database with cell value") End If rs.Close db.Close