Foxtable(狐表)用户栏目专家坐堂 → 跨表如何设置


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

主题:跨表如何设置

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


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/5/31 8:54:00 [显示全部帖子]

If e.DataCol.Name = "批次设置"  AndAlso e.DataRow("批次设置")  = True Then '复制行'
    For Each dc As DataCol In DataTables("库存商品批次汇总表").DataCols
        If e.DataTable.DataCols.Contains(dc.Name) AndAlso e.DataRow.IsNull(dc.name) Then
            messagebox.show("请先输入" & dc.name)
            Return
        End If
    Next
    If e.DataRow.IsNull("生产日期") = False Then
        Dim dr As DataRow = DataTables("库存商品批次汇总表").Find("货品编号 = '" & e.DataRow("货品编号") & "' And 批次 = '" & e.DataRow("批次")  & "'And 生产日期 = '" & e.DataRow("生产日期")  & "'And 规格 = '" & e.DataRow("规格") & "'And 型号 = '" & e.DataRow("型号") & "'")
        If dr IsNot Nothing
            Tables("库存商品批次汇总表").Position = Tables("库存商品批次汇总表").FindRow(dr)
        Else
            Dim r As Row = Tables("库存商品批次汇总表").AddNew()
            For Each dc As DataCol In DataTables("库存商品批次汇总表").DataCols
                If e.DataTable.DataCols.Contains(dc.Name) Then
                    r(dc.name) = e.DataRow(dc.name)
                End If
            Next
        End If
    End If
End If
Select Case e.DataCol.Name
    Case "货品编号","比率"
        Dim dr As DataRow = DataTables("货品资料").Find("货品编号 = '" & e.DataRow("货品编号") & "'")
        If dr IsNot Nothing AndAlso dr("比率填充为批次") = True
            e.DataRow("批次") =e.DataRow("比率")
        End If
End Select

 回到顶部