以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 从关联父、子表中提取数据填充到另表 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=96799) |
-- 作者:蓝蚂蚁 -- 发布时间:2017/2/28 9:44:00 -- 从关联父、子表中提取数据填充到另表 窗口【导出计划】按钮代码: DataTables("导出骨科计划表").DataRows.Clear 按照上面的代码得到下面的结果: 按条件查询筛选图
|
-- 作者:有点蓝 -- 发布时间:2017/2/28 9:47:00 -- 先把2个表单的数据合并成一个查询表,然后再填充
http://www.foxtable.com/webhelp/scr/2314.htm
|
-- 作者:有点色 -- 发布时间:2017/2/28 10:24:00 -- Dim t1 As Table = Tables("高值耗材病人使用登记表") Dim t2 As Table = Tables("高值耗材病人使用明细表") Dim dt As DataTable = DataTables("导出骨科计划表") dt.DataRows.Clear Dim sCols() As String = {"手术日期","患者姓名","计划人","计划类型"} Dim dCols() As String = {"中标号","组件名称","使用规格","厂家","单位","数量","中标价","采购价"} For Each r As Row In t1.Rows For Each cr As DataRow In t2.DataTable.Select("编号 = \'" & r("编号") & "\'") Dim ndr As DataRow = dt.AddNew For Each c As String In scols ndr(c) = r(c) Next For Each c As String In dcols ndr(c) = cr(c) Next Next Next Forms("导出骨科计划主窗口").Open |