以下是引用wealthwind在2014-4-23 14:50:00的发言:
这样导致,如果用行销部主管登陆和行销经理登陆,都无法给审核和审批意见了
批意见之前,可以先点取消。
你改一下代码吧,用下面这一段,测试ok的
Select Case e.DataCol.name
Case "审核意见", "审核日期", "审核"
If user.roles = "行销部主管" Then
If e.NewValue <> Nothing AndAlso e.OldValue <> Nothing AndAlso e.DataRow.IsNull("审核") = False Then
msgbox("已审核")
e.cancel = True
Else If e.DataRow.IsNull("批准日期") = False OrElse e.DataRow.IsNull("终审意见") = False Then
msgbox("已提交,不能再修改")
e.cancel = True
End If
Else
e.Cancel = True
End If
Case "批准意见" , "批准日期", "批准"
If User.roles = "行销部经理" Then
If e.NewValue <> Nothing AndAlso e.OldValue <> Nothing AndAlso e.DataRow.IsNull("批准") = False Then
msgbox("已批准")
e.Cancel = True
Else If e.DataRow.IsNull("终审日期") = False Then
msgbox("已提交")
e.cancel = True
End If
Else
e.Cancel = True
End If
Case "终审意见", "终审日期", "终审"
If User.roles = "boss" Then
If e.NewValue <> Nothing AndAlso e.OldValue <> Nothing AndAlso e.DataRow.IsNull("终审") = False Then
msgbox("已终审")
e.cancel = True
End If
Else
e.Cancel = True
End If
Case "个案申请","日期","编号","文件名称","分区","内容"
Select Case User.Group
Case "东北区", "西北区", "华北区", "华东区", "东南区", "华南区", "西南区"
If e.DataRow.IsNull("审核日期") = False Then
e.Cancel = True
End If
Case Else
e.Cancel = True
End Select
End Select