以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 求助,关联表自动填数据 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=137826) |
-- 作者:long086 -- 发布时间:2019/7/16 18:47:00 -- 求助,关联表自动填数据 有两张表一张客户资料表,一张客户交费表,客户资料表,有三列 客户编号,客户姓名,最后交费金额,客户交费表有客户编号,客户姓名,客户交费时间,客户交费金额。客户资料表是主表,通过客户编号关联,现在想要客户资料,最后交费时间,从客户交费表里面得到,客户最后一次交费的金额,自动填到客户资料表里面的 客户最后交费金额 列,请问老师如何实现。谢谢 |
-- 作者:有点蓝 -- 发布时间:2019/7/16 20:35:00 -- 参考:http://www.foxtable.com/webhelp/topics/1451.htm 客户交费表datacolchanged事件 Select Case e.DataCol.Name Case "客户编号","客户交费时间","客户交费金额" Dim dr As DataRow = e.DataTable.Find("客户编号=\'" & e.DataRow("客户编号") & "\'") If dr IsNot Nothing Then DataTables("客户资料表").DataCols("客户编号").RaiseDataColChanged(dr) End If End Select 客户资料表datacolchanged事件 Select Case e.DataCol.Name Case "客户编号" Dim dr As DataRow = DataTables("客户交费表").Find("客户编号=\'" & e.DataRow("客户编号") & "\'","客户交费时间 desc") If dr IsNot Nothing Then e.DataRow("最后交费金额") = dr("客户交费金额") End If End Select |
-- 作者:long086 -- 发布时间:2019/7/16 22:06:00 -- 你好。老师按照你的操作怎么不行
你好。老师按照你的操作怎么不行,新手求指点 ![]() ![]() [此贴子已经被作者于2019/7/16 22:14:39编辑过]
|
-- 作者:有点蓝 -- 发布时间:2019/7/16 22:27:00 -- 请认真看2楼,然后自己核对表名,列名 |