以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 重复提醒 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=92984) |
-- 作者:hongyefor -- 发布时间:2016/11/17 16:57:00 -- 重复提醒
我想在这两个输入完成后,如果表A有重复的合同号和款号,则提示“XXXX合同的XXX款号已存在,不能录入相同的数据!”然后清空这两个TextBox里输入的数据 请问这个代码怎么写,写在哪里? |
-- 作者:hongyefor -- 发布时间:2016/11/17 17:18:00 -- 没人知道吗? |
-- 作者:有点青 -- 发布时间:2016/11/17 18:56:00 -- 1、你应该加入一个查询按钮,代码写在那里
2、查询,直接用find
http://www.foxtable.com/webhelp/scr/0396.htm |
-- 作者:hongyefor -- 发布时间:2016/11/17 20:59:00 -- Dim hth As WinForm.TextBox = e.Form.Controls("合同号")
没反应啊 |
-- 作者:有点蓝 -- 发布时间:2016/11/17 21:15:00 -- Dim hth As WinForm.TextBox = e.Form.Controls("合同号") Dim kh As WinForm.TextBox = e.Form.Controls("款号") Dim drs As DataRow drs = DataTables("订单主表").Find("合同号 = \'" & hth.text & "\'and 款号 = \'" & kh.text & "\'") If drs IsNot Nothing Then \'如果找到的话 MessageBox.Show("已经有相同的款号数据") hth.text = "" kh.text = "" End If |