以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  权限设置  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=163070)

--  作者:朱女士
--  发布时间:2021/4/22 15:40:00
--  权限设置

老师您好!

    我有一个权限设置:表ylckb,校对是逻辑列,只有生产主管和综合主管有权限打勾或取消勾,我的代码没有达到目的,请指教!我的代码:

If e.Col.name="校对" Then
      If User.Group <>"综合主管" Or User.Group <>"生产主管"   Then
        e.Cancel = True
       ElseIf  e.Row("校对") = True And user.group="综合主管" Then

        e.Row("校对日期") = Date.Today()
      ElseIf e.Row("校对") = True And  user.group="生产主管"
       e.Row("校对日期") = Date.Today()

   End If

End If
   
If e.Row("校对")=True
   
   If user.group<>"综合主管" Or user.group<>"生产主管" Then
       e.cancel=True
       
    End If
End If


--  作者:有点蓝
--  发布时间:2021/4/22 15:51:00
--  
到命令窗口看看弹出什么内容?msgbox(user.group)

If e.Col.name="校对" Then
    If user.group <> "综合主管" AndAlso user.group <> "生产主管" Then
        e.cancel=True
    End If
End If

另外,赋值的代码请放到datacolchanged事件处理,不是什么代码都堆到一个事件处理的