请教高手:
两个表:材料入库表,库存材料表,材料入库表的数据复制到材料库存表,以入库单号作为限制条件,下面的代码有问题 ,不执行复制
请教:我哪里写错了,谢谢
'复制数据到库存表
If e.DataCol.Name = "入库单号" Then
Dim dh As DataRow
dh = DataTables("库存材料表").Find("[入库单号] = '" & e.NewValue & "'")
If dh IsNot Nothing Then
Return
End If
If dh Is Nothing Then
If e.DataCol.Name = "审核" AndAlso 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