Foxtable(狐表)用户栏目专家坐堂 → 自动复制行表A复制到三个表,代码能简化吗?


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

主题:自动复制行表A复制到三个表,代码能简化吗?

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


加好友 发短信
等级:超级版主 帖子:111427 积分:567211 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/9/29 10:40:00 [显示全部帖子]

If e.DataCol.Name = "审核" AndAlso e.DataRow("审核") = True Then
    Dim nma() As String = {"入库ID", "供应商名称", "金额", "部门ID"} 'A表数据来源列
    Dim nmb() As String = {"凭证ID", "供应商名称", "余额", "部门ID"} '原材料数据接收列
    Dim nmc() As String = {"凭证ID", "供应商名称", "贷方金额", "部门ID"} '原材料数据接收列
    Dim nmd() As String = {"凭证ID", "供应商名称", "借方金额", "部门ID"} '原材料数据接收列

    Dim dr As DataRow = DataTables("原材料").AddNew
    Dim dr1 As DataRow = DataTables("应付账款").AddNew
    Dim dr2 As DataRow = DataTables("应交税费").AddNew

    For i As Integer = 0 To nma.Length - 1
        dr(nmb(i)) = e.DataRow(nma(i))
        dr1(nmc(i)) = e.DataRow(nma(i))
        dr2(nmd(i)) = e.DataRow(nma(i))
    Next
End If

 回到顶部