Foxtable(狐表)用户栏目专家坐堂 → 如何一起复制关联表


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

主题:如何一起复制关联表

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106809 积分:543246 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/5/26 12:03:00 [显示全部帖子]

Dim ddbh As String = e.Form.controls("Textbox1").Text
Dim bh As String = e.Form.controls("textbox2").Text
If DataTables("订单表").Find("订单编号='" & bh & "'") IsNot Nothing Then
    msgbox("已存在此订单号" & bh)
    Return
End If
Dim ts() As String = {"成衣部位表","加工费用表","车工费用表","辅料表","订单表"}
For Each t As String In ts
    For Each dr1 As DataRow In DataTables(t).Select("订单编号='" & ddbh & "'")
        Dim dr2 As DataRow = DataTables(t).AddNew()
        For Each dc As DataCol In DataTables(t).DataCols
            If dc.name = "订单编号" Then
                dr2("订单编号") = bh
            Else
                dr2(dc.Name) = dr1(dc.name)
            End If
        Next
    Next
Next

 回到顶部