两个问题解决了,谢谢甜老师,第二个问题是这段
Select e.DataCol.Name Case "工程名称","设备编号","物品名称","型号规格"
If e.DataRow.IsNull("工程名称") OrElse e.DataRow.IsNull("设备编号") OrElse e.DataRow.IsNull("物品名称") OrElse e.DataRow.IsNull("型号规格")Then
Else
Dim fdr As DataRow = DataTables("电梯周材进场出库统计表").Find("工程名称 = '" & e.DataRow("工程名称") & "' and 设备编号 = '" & e.DataRow("设备编号") & "' and 物品名称= '" & e.DataRow("物品名称") & "' and 型号规格= '" & e.DataRow("型号规格") & "'")
If fdr Is Nothing Then
Dim nr As Row = Tables("电梯周材进场出库统计表").AddNew
nr("工程名称") = e.DataRow("工程名称")
nr("设备编号") = e.DataRow("设备编号")
nr("物品名称") = e.DataRow("物品名称")
nr("型号规格") = e.DataRow("型号规格")
nr("单位") = e.DataRow("单位")
nr("标准节规格") = e.DataRow("标准节规格")
End If
End If
End Select
每次只往电梯周材进场出库统计表里加三行,不知是什么原因?