以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 表格数据如何实现自动填列 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=170773) |
-- 作者:yuweijie -- 发布时间:2021/8/6 20:28:00 -- 表格数据如何实现自动填列 我有三张表格,customer表:id cname两列,产品表:cpid cpname两列, orde表:ddid cname cpname 数量4列。现在我的客户表有甲、乙两条记录,产品表有A B C三种产品。现在我要编码实现,按下按钮后,在定单表自动生成 甲 A 甲 B 甲 C 乙 A 乙 B 乙 C 六条记录,只留下数量列手动填写,改如何实现?
[此贴子已经被作者于2021/8/6 20:45:55编辑过]
|
-- 作者:有点蓝 -- 发布时间:2021/8/7 9:11:00 -- dim r as row for each r1 as row in tables("customer").rowsfor each r2 as row in tables("产品").rows r = tables("orde").addnew r("cname") = r1("cname") r("cpname") = r2("cpname") next next
|
-- 作者:yuweijie -- 发布时间:2021/8/7 9:19:00 -- 如果要对客户表先做个筛选呢,列如客户表有一列布尔型inactive 筛选出活跃客户再做上述操作呢? |
-- 作者:有点蓝 -- 发布时间:2021/8/7 9:32:00 -- for each r1 as row in tables("customer").rows 改为 for each r1 as datarow in datatables("customer").select("inactive =true")
|