把入库单复制到库存表的代码,错误在哪?谢谢!!
Select Case e.DataCol.Name
Case "入库单号","物料代码"
Dim rkdhs As List (of DataRow)
rkdhs = DataTables("库存材料表").Select("[入库单号] = '" & e.NewValue & "' And [物料代码] = '" & e.NewValue & "'")
For Each rkdh As DataRow In rkdhs
If rkdhs Is Nothing Then
If e.DataRow("记账") = True Then
Dim nma() As String = {"仓库代码","仓库名称","入库日期","物料代码","物料名称","规格型号","常用计量单位","材料单价","入库数量","入库金额","入库单号"} 'A表数据来源列
Dim nmb() As String = {"仓库代码","仓库名称","入库日期","物料代码","物料名称","规格型号","常用计量单位","材料单价","入库数量","入库金额","入库单号"} 'B表数据接收列
Dim dr As DataRow = DataTables("库存材料表").AddNew()
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End If
End If
Next
End Select