|
Private Sub Command14_Click()
Dim sql As String
Dim rs As New ADODB.Recordset
Dim intCount As Integer
rs.Open "查询2", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
intCount = rs.RecordCount
rs.Close
If MsgBox("您确实要执行删除操作吗?" & intCount & " 删除后数据不能被恢复!", vbQuestion + vbYesNo, "提示") = vbNo Then
Exit Sub
Else
DoCmd.Close
sql = "Delete FROM 表1 WHERE (((表1.中止)=True));"
CurrentProject.Connection.Execute sql
MsgBox "记录已被成功删除!", 0, "温馨提示"
End If
Set rs = Nothing
End Sub
[ 本帖最后由 Henry D. Sy 于 2009-1-2 07:23 编辑 ] |
|