For Each dr As DataRow In DataTables("R06_CheckMaterialAmount_Detail").Select("outboundQuantity >0 and outboundWagePrice is null")
' dr = DataTables("R06_CheckMaterialAmount_Detail").Find("outboundQuantity >0 and outboundWagePrice is null") 删除这行
If dr IsNot Nothing Then '如果找到符合条件的
Dim dr1 As DataRow
dr1 = DataTables("R06_CheckMaterialAmount_Detail").Find("(tableCode='R03_InboundProducts' Or tableCode='R03_Delegation') And (itemID = '" & dr("itemID") & "') and (number> '"&dr("number")&"')","number",0)
If dr1 IsNot Nothing Then '如果找到符合条件的
dr("outboundWagePrice")=dr1("inboundWagePrice")
dr.save
End If
End If
Next
是不是这才是你想要的效果!