![]() |
#2
风吹过b2017-06-04 12:38
|

Private Sub Command2_Click()
Dim Rs As ADODB.Recordset
Dim Sql As String
Dim MsgTxt As String
Dim NR1 As String
Dim RQ1 As String
If List3.ListIndex = -1 Then Exit Sub
RQ1 = List1.List(List3.ListIndex)
NR1 = List2.List(List3.ListIndex)
Sql = "delete * from MYBOOK where RQ=RQ1"
Set Rs = ExecuteSQL(Sql, MsgTxt)
If InStr(MsgTxt, "错误") Then
MsgBox MsgTxt, vbCritical, "错误提示"
Exit Sub
End If
Text1.Text = ""
i = List3.ListIndex
List1.RemoveItem i
List2.RemoveItem i
List3.RemoveItem i
End Sub
Dim Rs As ADODB.Recordset
Dim Sql As String
Dim MsgTxt As String
Dim NR1 As String
Dim RQ1 As String
If List3.ListIndex = -1 Then Exit Sub
RQ1 = List1.List(List3.ListIndex)
NR1 = List2.List(List3.ListIndex)
Sql = "delete * from MYBOOK where RQ=RQ1"
Set Rs = ExecuteSQL(Sql, MsgTxt)
If InStr(MsgTxt, "错误") Then
MsgBox MsgTxt, vbCritical, "错误提示"
Exit Sub
End If
Text1.Text = ""
i = List3.ListIndex
List1.RemoveItem i
List2.RemoveItem i
List3.RemoveItem i
End Sub
说明ACCESS数据库就2个字段,分别是RQ和NR
[此贴子已经被作者于2017-6-4 12:29编辑过]