以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  两个子表之前相互复制  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=154594)

--  作者:the6520
--  发布时间:2020/9/19 19:00:00
--  两个子表之前相互复制
Dim a As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim Cols1() As String = {"项目编号","区域","编号","产品名称","产品名称","规格_高","规格_宽","规格_厚","组数"}
Dim Cols2() As String = {"项目编号","区域","编号","物料编号","产品名称","规格_高","规格_宽","规格_厚","组数"}
For Each dr1 As DataRow In DataTables("工价详单").Select("[项目编号] = \'*" & a.Text & "*\'")
    Dim dr2 As DataRow = DataTables("木工工价详单").AddNew()
    For i As Integer = 0 To Cols1.Length -1
        dr2(Cols2(i)) = dr1(Cols1(i))
    Next
Next



哪们老大能帮我看一下这段代码有哪里有问题?怎么不起作用,复制的两个表是关联到同一个父表的子表,想复制几列内容,要示是和当前父表当前行项目编号一样的几行数据

--  作者:有点蓝
--  发布时间:2020/9/20 20:13:00
--  
For Each dr1 As DataRow In DataTables("工价详单").Select("[项目编号] = \'" & a.Text & "\'")
--  作者:the6520
--  发布时间:2020/9/28 18:54:00
--  
谢谢蓝老师,解决了,原来是这么弱智的问题图片点击可在新窗口打开查看