物料计划表,需要引用采购明细表里面的供货单位:
If e.DataCol.Name = "识别号" Then
Dim nms() As String = {"供货单位"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("采购明细").Find("[识别号] = '" & e.NewValue & "'")
If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If
采购明细表,需要引用物料计划表的订单号,交期:
If e.DataCol.Name = "识别号" Then
Dim nms() As String = {"订单号","交期"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("物料计划").Find("[识别号] = '" & e.NewValue & "'")
If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If
以上二段代码,第二段可以实现,第一段不能实现,求救