使用事务处理
On Error GoTo Cmd还原_err
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Set Conn = CurrentProject.Connection
Set Rs = New ADODB.Recordset
'事务处理
Conn.BeginTrans
Rs.Open "select * from tbl积分 ", Conn, adOpenDynamic, adLockOptimistic
Rs.AddNew
Rs!Name = "甲"
Rs!送 = 1000
Rs.update
Rs.AddNew
Rs!Name = "乙"
Rs!收 = 1000
Rs.update
Conn.CommitTrans
Boolintrans = False
Rs.Close
Set Rs = Nothing
Exit_Cmd还原:
Exit Sub
Cmd还原_err:
If Boolintrans Then
Conn.RollbackTrans
End If
MsgBox Err.Description
Resume Exit_Cmd还原
End Sub