DataTables("项目用无损检验资质清单").DeleteFor("生产令号 = '" & e.DataRow("生产令号") & "'And 机组 = '" & e.DataRow("机组") & "'And 资质名称 = '" & e.DataRow("编制人资质") & "' And 姓名 = '" & e.DataRow("编制人") & "'And 等级 = '" & e.DataRow("编制人等级") & "'")
改成
Dim filter As String = "1=1"
If e.DataRow("编制人等级") = Nothing Then
filter &= " and 等级 is null"
Else
filter &= " and 等级 = '" & e.DataRow("编制人等级") & "'"
End If
If e.DataRow("编制人") = Nothing Then
filter &= " and 姓名 is null"
Else
filter &= " and 姓名 = '" & e.DataRow("编制人") & "'"
End If
......
msgbox(filter)
DataTables("项目用无损检验资质清单").DeleteFor(filter)
[此贴子已经被作者于2019/5/14 17:08:31编辑过]