Foxtable(狐表)用户栏目专家坐堂 → [求助]父表如何引用两个子表数据


  共有3410人关注过本帖树形打印复制链接

主题:[求助]父表如何引用两个子表数据

帅哥哟,离线,有人找我吗?
czy
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章 三级勋章 二级勋章
等级:超级版主 帖子:6318 积分:33951 威望:0 精华:10 注册:2008/8/31 20:56:00
  发帖心情 Post By:2014/12/15 13:40:00 [显示全部帖子]


If e.DataCol.Name = "产品图号" Then
    If e.NewValue Is Nothing Then
        e.DataRow("库房保管员") = Nothing
        e.DataRow("车间名称") = Nothing
        e.DataRow("产品名称") = Nothing
        e.DataRow("销售保管员") = Nothing
    Else
        Dim dr As DataRow
        dr = DataTables("车间入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 库房保管员 is not null")
        If dr IsNot Nothing
            e.DataRow("库房保管员") = dr("库房保管员")
        End If
        dr = DataTables("车间入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 车间名称 is not null")
        If dr IsNot Nothing
            e.DataRow("车间名称") = dr("车间名称")
        End If
        dr = DataTables("车间入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 产品名称 is not null")
        If dr IsNot Nothing
            e.DataRow("产品名称") = dr("产品名称")
        End If
        dr = DataTables("销售入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 销售保管员 is not null")
        If dr IsNot Nothing
            e.DataRow("销售保管员") = dr("销售保管员")
        End If
    End If
End If

 

不过感觉这样很不妥,比如一个图号下如果有多个生产车间就会有问题。


 回到顶部