你好,以下代码中可不可以帮忙加一个条件,如果表PrintHistory已经存在相同的PartNo,就不再新增该记录。谢谢。
Dim t1 As Table = Tables("生产任务单")
Dim nmb() As String = {"生产任务单号","产品名称","数量","PrintTime"}
Dim nma() As String = {"生产任务单号","PartNo","Qty","PrintTime"}
For r As Integer = t1.TopPosition To t1.BottomPosition
Dim dr As Row = Tables("PrintHistory").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nma(i)) = t1.rows(r)(nmb(i))
Next
Next