Foxtable(狐表)用户栏目专家坐堂 → prepareedit 问题


  共有2453人关注过本帖树形打印复制链接

主题:prepareedit 问题

帅哥哟,离线,有人找我吗?
edisontsui
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1511 积分:9801 威望:0 精华:0 注册:2014/12/18 16:12:00
prepareedit 问题  发帖心情 Post By:2021/1/18 15:38:00 [显示全部帖子]

Select Case e.Col.name 
    Case "缺陷代号","缺陷数量"
        If user.name <> "开发者" AndAlso user.name <> "行政" 
            e.Cancel = True
        End If

End Select

If e.Col.Name <> "会计核对" AndAlso e.Col.Name <> "录入员核对" AndAlso e.Col.Name <> "准备删除" AndAlso e.Col.Name <> "缺陷代号" AndAlso e.Col.Name <> "缺陷数量" Then 
    If e.Row("录入员核对") = True Then '如果此列已经核对了,则禁止修改会计核对列和录入员核对列之外的列
        e.Cancel = True 
    End If
End If

If e.Col.Name <> "批号" AndAlso e.Col.Name <> "录入员核对" AndAlso e.Col.Name <> "会计核对" AndAlso e.Col.Name <> "准备删除" AndAlso e.Col.Name <> "缺陷代号" AndAlso  e.Col.Name <> "缺陷数量" Then 
    If e.Row("会计核对") = True Then  '如果此列已经核对了,则禁止修改批号和录入员核对和会计核对列之外的列
        e.Cancel = True 
    End If
End If

上述prepareedit代码的目的是:只允许“开发者”和“行政”两组用户对“缺陷代号”和“缺陷数量”进行编辑。但是实际执行结果是,有时候某些数据行不允许编辑,有时候全部数据行都允许编辑。所以,不知道什么原因导致的,我感觉是不是电脑内存不够导致的,还是其他原因?

 回到顶部
帅哥哟,离线,有人找我吗?
edisontsui
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1511 积分:9801 威望:0 精华:0 注册:2014/12/18 16:12:00
  发帖心情 Post By:2021/1/20 16:56:00 [显示全部帖子]

我把 select 改为 if 语句,似乎就可以了,先试用再说。

 回到顶部