数据删除问题请教
各位同志:请教一个问题,我在删除表中的一行数据时不知为什么中出现“不能删除最后的非固定行”的错误提示!但发现其中的数据倒是也被删除了。但不知道这是什么问题,如何解决?请指教,谢谢!如下是本人的删除语句:Private Sub Command1_Click()
Dim answer As String
Dim delete_row As String
On Error GoTo delerror
answer = MsgBox("确定要删除吗?", vbYesNo + vbQuestion, "请注意")
If answer = vbYes Then
rs_gongyi.MoveFirst
Dim i As Integer
For i = 0 To rs_gongyi.RecordCount - 1
If rs_gongyi.Fields(0) = Text1.Text Then
rs_gongyi.Delete
rs_gongyi.Update
MsgBox "删除成功!", vbOKOnly + vbExclamation, "恭喜你"
With grdLoupan
.RemoveItem getrow
End With
Exit Sub
End If
rs_gongyi.MoveNext
Next i
Else
Exit Sub
End If
Exit Sub
delerror:
MsgBox Err.Description
End Sub