以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 关于messagebox (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=170107) |
-- 作者:wangglby -- 发布时间:2021/7/13 8:38:00 -- 关于messagebox 同一个messagebox,有时会连续弹出来,能限制 一段时间只弹出一次吗 |
-- 作者:有点蓝 -- 发布时间:2021/7/13 8:40:00 -- 代码写在什么地方?怎么用的?贴出详细代码说明问题:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=150626 |
-- 作者:wangglby -- 发布时间:2021/7/13 8:52:00 -- 代码在 datacolchanged 里面
类似以下代码 If e.DataCol.Name = "材料标识" Then
If e.NewValue Is Nothing Then e.DataRow("材料单价") = Nothing Else Dim dr As DataRow dr = DataTables("表d").Find("[材料标识] = \'" & e.NewValue & "\'") If dr IsNot Nothing Then e.DataRow("材料单价") = dr("合同基价")/1000 Else e.DataRow("物料信息_材料单价") = Nothing messagebox.show(“ 无价格”) End If End If End If |
-- 作者:有点蓝 -- 发布时间:2021/7/13 9:04:00 -- 方法1、不要使用messagebox,改为放到状态栏显示:http://www.foxtable.com/webhelp/topics/0639.htm 2、 dr = DataTables("表d").Find("[材料标识] = \'" & e.NewValue & "\'") If dr IsNot Nothing Then e.DataRow("材料单价") = dr("合同基价")/1000 Else e.DataRow("物料信息_材料单价") = Nothing Static dt As Date = Date.Now \'静态变量,用于保存上次备份的时间 Dim tp As TimeSpan End If |