Private Sub 数据初始化_Click() Dim stemp As Integer Dim stemp1, stemp2 As String Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset stemp2 = "select * from 基表1" rs.Open stemp2, CurrentProject.Connection, adOpenKeyset, adLockOptimistic If rs.RecordCount > 0 Then stemp = MsgBox("really to remove them?", 257, "warning") If stemp = 1 Then stemp1 = "delete * from 基表1" DoCmd.RunSQL stemp1 Else Exit Sub End If MsgBox "The records have delete already!", vbExclamation, "information" Else MsgBox "Nothing to Remove", vbExclamation, "confirm" End If End Sub |