以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]权限公式  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=68758)

--  作者:wusim
--  发布时间:2015/5/24 14:38:00
--  [求助]权限公式
要求:
当确认列不为空,锁定行,只有角色是“电梯审核“时,可以编辑审核退回意见,只有是角色是批准时,可以编辑审批退回意见,

当确认列为空,锁定行,除了审核退回意见列和审批退回意见列,不能编辑。

If e.Row.IsNull("确认") = False Then \'如果确认列不为空
   e.Cancel =True
End If
 If e.Row.IsNull("审核") = True Then
 If e.Col.Name = "审核退回意见" Then
  If User.Isrole("电梯审核") Then
  e.Cancel = False
End If
End If
End If
  If e.Row.IsNull("批准") = True Then
  If e.Col.Name = "批准退回意见" Then
  If User.Isrole("审批") Then
  e.Cancel = False
End If
End If
End If
 If e.Col.Name = "审核退回意见" And e.Col.Name = "审批退回意见"  Then   
  If User.Isrole  ("录入") Then
  e.Cancel =True
End If
End If

哪里出现问题?

--  作者:大红袍
--  发布时间:2015/5/24 14:53:00
--  
Select Case e.Col.name
    Case "审核退回意见", "批准退回意见"
        If e.Row.IsNull("确认") = False Then
            If e.Col.Name = "审核退回意见" Then
                If User.Isrole("电梯审核") = False Then
                    e.Cancel = True
                End If
            Else If e.Col.Name = "批准退回意见" Then
                If User.Isrole("审批") = False Then
                    e.Cancel = True
                End If
            End If
        Else
            e.cancel = True
        End If
    Case Else
        If e.Row.IsNull("确认") = False Then
            e.cancel = True
        End If
End Select