以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]对逻辑列进行判断后,功能代码无法执行! (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=126022) |
-- 作者:lunengcheng -- 发布时间:2018/10/12 11:42:00 -- [求助]对逻辑列进行判断后,功能代码无法执行! 各位老师前辈,请教一个问题,我写了下面这段代码,保存在按钮里面执行,结果前面的判断是可以执行的,但是后面的保存功能无法执行,不知道问题点在哪里,忘各位老师前辈指点一下! \'判断是否被锁定 Dim r As Row = Tables(eform.name & "_Table1").Current If r IsNot Nothing Then \'判断表是否被锁定 If r("锁定表")=True Then If MessageBox.Show("该表已经被锁定, 无法进行操作, 请检查!","提 示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) = DialogResult.Cancel Then Exit Function End If \'判断行是否被锁定 If r("锁定行")=True Then If MessageBox.Show("该记录已经被锁定, 无法进行操作, 请检查!","提 示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) = DialogResult.Cancel Then Exit Function End If End If End If Else \'操作按钮功能 Tables(eform.name & "_Table1").Save MessageBox.Show("恭喜,已成功保存修改!") End If |
-- 作者:有点甜 -- 发布时间:2018/10/12 11:55:00 -- \'判断是否被锁定 Dim r As Row = Tables(eform.name & "_Table1").Current If r IsNot Nothing Then \'判断表是否被锁定 If r("锁定表")=True Then If MessageBox.Show("该表已经被锁定, 无法进行操作, 请检查!","提 示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) = DialogResult.Cancel Then Exit Function End If Else \'操作按钮功能 Tables(eform.name & "_Table1").Save MessageBox.Show("恭喜,已成功保存修改!") End If End If |
-- 作者:lunengcheng -- 发布时间:2018/10/12 12:01:00 -- 老师,这样只能判断一个列了,我是有两个列的要判断的,如果列一符合条件则触发提示1,然后退出,如果列二符合条件则触发提示2,然后退出,如果两列都不符合条件,才执行下面的保存代码! |
-- 作者:有点甜 -- 发布时间:2018/10/12 12:08:00 -- Dim r As Row = Tables(eform.name & "_Table1").Current If r IsNot Nothing Then \'判断表是否被锁定 If r("锁定表")=True Then If MessageBox.Show("该表已经被锁定, 无法进行操作, 请检查!","提 示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) = DialogResult.Cancel Then Exit Function End If ElseIf r("锁定行")=True Then If MessageBox.Show("该记录已经被锁定, 无法进行操作, 请检查!","提 示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) = DialogResult.Cancel Then Exit Function End If Else \'操作按钮功能 Tables(eform.name & "_Table1").Save MessageBox.Show("恭喜,已成功保存修改!") End If End If |
-- 作者:lunengcheng -- 发布时间:2018/10/12 12:13:00 -- ok,可以用了,多谢老师! |