VB's documentation on the AddNew and Edit methods states:
"In the Professional Edition, if you are not using a data control and use one of the Find or Move methods or close the recordset while an Edit or AddNew operation is pending, any existing changes will be lost and no error will occur."
Thus, a simple way to cancel an edit is to move off of the current record.But it's actually possible to cancel an edit without leaving the currentrecord (eliminating the need to move back to it):
' In VB4...
Dim rs As Recordset
' Begin an edit
rs.Edit
...
' Cancel it
rs.Move 0
' In VB3...
Dim ds As Dynaset
Dim sBkMk As String
' Save bookmark of current record
sBkMk = ds.Bookmark
' Begin an edit
ds.Edit
...
' Cancel it
ds.Bookmark = sBkMk
|