你好 狐爸
我需要对比同一行中 两个单元格 内容是否相同 如相同 则清除后输入的单元格信息
但一直不得其门 望指点 谢谢
两列 均是字符型 列属性 输入掩码是 “00000000000” 11个"零"
具体操作如下 第一段没问题 第二段中出现异常,无法判定相同 直接显示输入的号码, 如将 s1 = s2 替换为 s1<> s2 则 无论输入什么手机号码 均无法保存 同时有弹出框提示
if e.datacol.name = "新手机号码" then
if e.datarow.isnull("旧手机号码" ) = true then
e.cancel = true
messagebox.show("请先输入旧手机号码")
end if
end if
if e.datacol.name = "新手机号码" then
if e.newvalue isnot nothing then
dim s1 as string = e.datarow("旧手机号码" )
dim s2 as string = e.datarow("新手机号码" )
if s1 = s2
e.cancel = true
messagebox.show("手机号码重复")
end if
end if
end if