请问哪里出了问题,以前可以删除记录的,几个月了就不可以了?
Dim Filter As String
With e.Form.Controls("Comzjh")
If .Value IsNot Nothing Then
Filter = "主机号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("Comhlh")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "回路号 = '" & .Value & "'"
Tables("报警设备定义").Filter = Filter
Dim dr As DataRow
dr = DataTables("报警设备定义").Find(Filter)
Dim Result As DialogResult
Result = MessageBox.Show("你确定要删除该回路的所有数据吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
DataTables("报警设备定义").DeleteFor("回路号 = '" & .Value & "'")
Else
MessageBox.Show("请及时保存修改的数据!","提示")
End If
End If
End With
[此贴子已经被作者于2020/9/12 18:53:35编辑过]