以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]CellButtonClick事件代码执行问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=177107) |
||||
-- 作者:天一生水 -- 发布时间:2022/5/9 15:29:00 -- [求助]CellButtonClick事件代码执行问题 老师好! 下面是一段CellButtonClick代码。 第二段代码里的 MsgBox("无二审案号!") 这个弹出信息,在每次运行第一段代码时,也会弹出,是什么原因? If e.Col.Name = "上传笔录1" And e.Row.IsNull("案号") = False Then e.Cancel = True \'取消默认动作 MsgBox(1) End If If e.Col.Name = "上传笔录2" And e.Row.IsNull("二审案号") = False Then e.Cancel = True \'取消默认动作 MsgBox(2) Else e.Cancel = True \'取消默认动作 MsgBox("无二审案号!") End If
|
||||
-- 作者:有点蓝 -- 发布时间:2022/5/9 15:41:00 -- 代码本来就是按顺序执行的啊,执行完第一段代码,当然就执行第二段了 |
||||
-- 作者:天一生水 -- 发布时间:2022/5/9 15:55:00 -- 但是我点击的是[上传笔录1]列。 另外,第一行的[二审案号]不为空,点击[上传笔录1]列,也会弹出“无二审案号”,这就不对了~ |
||||
-- 作者:有点蓝 -- 发布时间:2022/5/9 16:15:00 -- 点击[上传笔录1]列肯定就不符合下面红色的条件,那么当然就执行else的代码呀 If e.Col.Name = "上传笔录2" And e.Row.IsNull("二审案号") = False Then e.Cancel = True \'取消默认动作 MsgBox(2) Else e.Cancel = True \'取消默认动作 MsgBox("无二审案号!") End If 是不是应该这样 If e.Col.Name = "上传笔录2" then if e.Row.IsNull("二审案号") = False Then e.Cancel = True \'取消默认动作 MsgBox(2) Else e.Cancel = True \'取消默认动作 MsgBox("无二审案号!") end if End If |