以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]跨表数据同步 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=145349) |
-- 作者:i12cu -- 发布时间:2020/1/16 21:12:00 -- [求助]跨表数据同步 "可用库存"的数据自动填入,来源于"block入库",当"入库"为true and "锁定"为false时,将数据添加到"可用库存","锁定"为true时,"可用库存"内对应"block批号"的行删除. 当表"block上料"的"block完全消耗"=true时,"可用库存"内对应"block批号"的行删除.
老师,我应该在哪个表事件写什么样的代码? 新手入门,恳请指导.谢谢 |
-- 作者:有点蓝 -- 发布时间:2020/1/17 9:20:00 -- 入库表datacolchanged事件 If e.DataCol.name = "入库" Then If e.newvalue = True Dim dr As DataRow = DataTables("可用库存").addnew dr("block批号") = e.DataRow("block批号") dr("某列") = e.DataRow("某列") End If ElseIf If e.DataCol.name = "锁定" Then If e.newvalue = True Dim dr As DataRow = DataTables("可用库存").find("block批号=\'" & e.DataRow("block批号") & "\'") If dr IsNot Nothing Then dr.Delete End If End If End If 表"block上料"datacolchanged用法一样,参考上面自己做 |
-- 作者:i12cu -- 发布时间:2020/1/17 16:01:00 -- 谢谢老师,搞定了. |