假如:销售汇总表(爷表)通过销售单号与订单汇总表(父表)建立联系,而订单汇总表(父表)通过订单编号与订单明细表(孙表)建立联系,现在要在爷表引用孙表数据(“影楼名称”一列)怎么实现?求高手指点。谢!
我这个代码为什么不能出现结果呢?
If e.DataCol.Name = "销售单号" Then
If e.NewValue Is Nothing Then
e.DataRow("影楼名称") = Nothing
Else
Dim dr As DataRow
Dim a As String
dr = DataTables("订单汇总表").find("[销售单号] = '" & e.NewValue & "'")
If dr IsNot Nothing Then
a=dr("订单编号")
Dim dt As DataRow
dt=DataTables("生产订单明细表").find("[订单编号]=a")
If dt IsNot Nothing Then
e.DataRow("影楼名称") = dt("影楼名称")
End If
End If
End If
End If
[此贴子已经被作者于2014-8-18 0:49:47编辑过]