代码这样写,取消按钮,就把日期设置成nothing,意见设置成nothing。自己调试一下。
Select Case e.DataCol.name
Case "审核意见", "审核日期"
If e.NewValue <> Nothing AndAlso e.OldValue <> Nothing Then
msgbox("已审核")
e.cancel = True
Else If e.DataRow.IsNull("批准日期") = False OrElse e.DataRow.IsNull("终审意见") Then
msgbox("已提交,不能再修改")
e.cancel = True
End If
Case "批准意见" , "批准日期"
If e.NewValue <> Nothing AndAlso e.OldValue <> Nothing Then
msgbox("已批准")
e.Cancel = True
Else If e.DataRow.IsNull("终审日期") = False Then
msgbox("已提交")
e.cancel = True
End If
Case "终审意见", "终审日期"
If e.NewValue <> Nothing AndAlso e.OldValue <> Nothing Then
msgbox("已终审")
e.cancel = True
End If
Case Else
If e.DataRow.IsNull("审核日期") = False OrElse e.DataRow.IsNull("批准日期") = False OrElse e.DataRow.IsNull("终审日期") = False Then
msgbox("不能修改")
e.cancel = True
End If
End Select