当我使用下面的代码时,有时会收到错误 3021。仅当我在记录集中有一条记录时才会发生这种情况。你能告诉我为什么,以及如何解决它吗?看来我什么都试过了!
谢谢
Private Sub cmdDelSelectedAction_Click()
response = MsgBox("Are you sure?", vbYesNo, "Confirmation required")
If response = vbNo Then Exit Sub
If Me.[Arrangement-Actions subform].Form.Recordset.EOF Then
Me.[Arrangement-Actions subform].Form.Recordset.MovePrevious
End If
If Me.[Arrangement-Actions subform].Form.Recordset.BOF Then
Me.[Arrangement-Actions subform].Form.Recordset.MoveNext
End If
Me.[Arrangement-Actions subform].Form.Recordset.Delete
Me.[Arrangement-Actions subform].Form.Recordset.MoveNext
End Sub