以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 批量复制列到表b (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=150615) |
||||
-- 作者:yangwenghd -- 发布时间:2020/6/3 10:19:00 -- 批量复制列到表b 此主题相关图片如下:qq截图20200603101946.jpg
|
||||
-- 作者:有点蓝 -- 发布时间:2020/6/3 10:38:00 -- 遍历勾选的列:http://www.foxtable.com/webhelp/topics/1776.htm |
||||
-- 作者:yangwenghd -- 发布时间:2020/6/3 22:32:00 -- 、 老师,能在帮忙看看这个吗?复制的是相同的行,不是不显示出来的行复制处理,感谢 感谢 For Each r As Row In Tables("窗口1_Table1").GetCheckedRows Tables("窗口1_Table1").Filter = r.Checked = True Next ’筛选出选中的行 For Each dr1 As DataRow In DataTables("表A").Select("") For Each dr1 As DataRow In Tables("窗口1_Table1").Select("") ’可以是窗口控件的表格吗? Dim dr2 As DataRow = DataTables("表B").AddNew() For Each dc As DataCol In DataTables("表A").DataCols \'dr2(dc.Name) = dr1(dc.name) dr2("型号")=Tables("窗口1_Table1").Current("第一列") dr2("采购价格")=Tables("窗口1_Table1").Current("单价") dr2("状态")=e.form.controls("ComboBox1").text dr2("合同号")=e.form.controls("TextBox2").text Next Next [此贴子已经被作者于2020/6/3 23:04:16编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2020/6/4 9:00:00 -- For Each dr1 As DataRow In dataTables("窗口1_Table1").datarows ’可以是窗口控件的表格吗? Dim dr2 As DataRow = DataTables("表B").AddNew() \'dr2(dc.Name) = dr1(dc.name) dr2("型号")=dr1("第一列") dr2("采购价格")=dr1("单价") dr2("状态")=e.form.controls("ComboBox1").text dr2("合同号")=e.form.controls("TextBox2").text Next
|
||||
-- 作者:yangwenghd -- 发布时间:2020/6/4 21:50:00 -- 谢谢老师,为什么报错显示不存在呢? |
||||
-- 作者:有点蓝 -- 发布时间:2020/6/4 22:05:00 -- For Each dr1 As Row In Tables("窗口1_Table1").rows |
||||
-- 作者:yangwenghd -- 发布时间:2020/6/4 22:20:00 -- 谢谢老师,可以了 感谢 感谢 ,这个筛选被选中的行是那里不对呀,没有反应呢,感谢 For Each r As Row In Tables("窗口1_Table1").GetCheckedRows Tables("窗口1_Table1").Filter = r.Checked = True Next |
||||
-- 作者:有点蓝 -- 发布时间:2020/6/4 22:41:00 -- http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=144412&replyID=44997&skin=1 |
||||
-- 作者:yangwenghd -- 发布时间:2020/6/6 21:24:00 -- 老师,能帮忙你看看这个吗?就筛选选中序号的行后,还是被勾选的状态,实在是不知道如何改, 感谢 感谢 Dim t As Table = e.Form.Controls("Table1").Table For Each r As Row In t.GetCheckedRows If lst.contains(r("_Identify")) = False lst.Add(r("_Identify")) End If Next t.ApplyFilter = not t.ApplyFilter For Each r As Row In t.Rows If lst.Contains(r("_Identify")) Then r.Checked = True End If Next Dim s As String = "" For Each r As Row In Tables("窗口1_Table1").GetCheckedRows s =s & "," & r("_Identify") Next s = s.Trim(",") Tables("窗口1_Table1").Filter = "[_Identify] in (" & s & ")"
|
||||
-- 作者:有点蓝 -- 发布时间:2020/6/7 20:43:00 -- Dim t As Table = e.Form.Controls("Table1").Table For Each r As Row In t.GetCheckedRows If lst.contains(r("_Identify")) = False lst.Add(r("_Identify")) End If Next Dim s As String = "" For Each r As Row In Tables("窗口1_Table1").GetCheckedRows s =s & "," & r("_Identify") Next s = s.Trim(",") t.Filter = "[_Identify] in (" & s & ")" For Each r As Row In t.Rows If lst.Contains(r("_Identify")) Then r.Checked = True End If Next
|