以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 关于验证重复电话号码的代码 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=123851) |
-- 作者:kljbdjz -- 发布时间:2018/8/24 15:22:00 -- 关于验证重复电话号码的代码 \'验证重复电话号码 If e.DataCol.Name = "联系电话" Then If e.NewValue IsNot Nothing Then \'且电话号码不为空值时 Dim drl As Integer drl = Tables("询盘表").Find("" & e.NewValue & "", 0, "联系电话", False, False, False) If drl > -1 Then \'假如找到联系电话 Dim Result9 As DialogResult Result9 = MessageBox.Show("电话号码已存在!是否查找此号码?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result9 = DialogResult.Yes Then Tables("询盘表").Position = drl e.DataRow("联系电话") = Nothing End If End If End If End If 代入如上,想设置在录入电话号码时,如果有重复的,提示不能录入,可是每次我输入任何非空值时,都会出现弹窗,貌似跳过了 If drl > -1 Then 这段条件限制,直接执行下面的代码了! 我任意输入222也会出现弹窗 |
-- 作者:有点蓝 -- 发布时间:2018/8/24 15:54:00 -- 用这种用法:http://www.foxtable.com/webhelp/scr/2481.htm |