表A编辑窗口中增加一个“审批”按钮,此按钮代码为:
If User.Group = "行政办" Then
Tables("表A").Current("审批人") = User.Name
Tables("表A").Current("审批日期") = Date.Today()
Else
MessageBox.show("你无审批权限!")
End If
然后该表编辑窗口再增加一个“取消审批”按钮,代码如下:
If User.Group = "行政办" Then
Tables("表A").Current("审批人") = Nothing
Tables("表A").Current("审批日期") = Nothing
Else
MessageBox.show("你无取消审批权限!")
End If
表A增加一个“审批”逻辑列,并在表属性
DatacolChanging事件,写代码 If e.DataCol.Name = "审批" Then '只有经理才能审批 If User.Group <> "行政办" Then e.Cancel = True End If ElseIf e.DataRow("审批") = True Then '如果此行已经审批了,则禁止修改 e.Cancel = True End If If e.DataRow.IsNull("审批人") = False Then '如果审批人列不为空 e.Cancel = True '则禁止编辑 End If
|
这样设置后还是不行。点击审批按钮后,审批人列有名字,但审批日期无内容,且审批逻辑列也点击不了,表中内容及录入窗口中的内容依然可以更改