第一个问题,这样改。
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.DataRow.IsNull("审核") Then
msgbox("没审核")
e.Cancel = True
Else 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.DataRow.IsNull("批准") Then
msgbox("没批准")
e.Cancel = True
Else 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