关于Access快速开发平台审核权限的代码优化
时 间:2020-01-22 09:53:27
作 者:Victor Duane ID:70 城市:闵行
摘 要:优化了审核权限与撤消审核权限按钮代码,集成权限管理。
正 文:
UpdData Me.btnAudit
Call CurrentPermissions
End Sub
Private Sub btnUndoAudit_Click()
UpdData Me.btnUndoAudit
Call CurrentPermissions
End Sub
Private Sub Form_Load()
ApplyTheme Me
LoadLocalLanguage Me
If Nz(Me.OpenArgs) <> "" Then
LoadRecord Me, "Select * FROM [tbl考勤账套设置] Where [ID]=" & Nz(Me.OpenArgs, 0)
End If
If Me.DataEntry Then
Me![ID] = Null
Me.Creator = myNickName
End If
' Me.btnSave.Enabled = Me.AllowEdits
Call CurrentPermissions
End Sub
Public Sub CurrentPermissions()
Me.btnAudit.Enabled = False
Me.btnUndoAudit.Enabled = False
Me.btnSave.Enabled = Me.AllowEdits
If Nz(Me.OpenArgs) <> "" Then
If Me.关账 Then
EnableButton Me.btnUndoAudit, HasPermission("考勤账套设置", "Undo Audit")
Me.btnSave.Enabled = False
Else
EnableButton Me.btnAudit, HasPermission("考勤账套设置", "Audit")
End If
End If
End Sub
Public Sub UpdData(ctl As Control)
Dim UpdDataFlag As Boolean
Dim strSQL As String
Dim strMsg As String
Dim blnBook As Boolean
Dim dtmLastSaveTime As Date
Dim strLastSaveBy As String
UpdDataFlag = ctl.Enabled
dtmLastSaveTime = Now
strLastSaveBy = myNickName
If ctl.Name = "btnAudit" Then
blnBook = True
strMsg = "该期间的考勤数据即将通过审核," & vbCrLf _
& "通过审核后,当期考勤数据将不能修改," & vbCrLf _
& "是否通过审核?"
ElseIf ctl.Name = "btnUndoAudit" Then
blnBook = False
strMsg = "该期间的考勤数据即将撤消审核," & vbCrLf _
& "撤消审核后,当期考勤数据将可以修改," & vbCrLf _
& "是否撤消审核?"
End If
strSQL = "Update tbl考勤账套设置 " _
& " SET 关账 = " & blnBook & ", LastSaveTime =#" & dtmLastSaveTime & "# , LastSaveBy = '" & myNickName & "'" _
& " Where [ID]=" & Nz(Me![ID], 0)
If UpdDataFlag Then
If MsgBox(strMsg, vbOKCancel + vbInformation, "提示") = vbOK Then
CurrentDb.Execute strSQL
MsgBox "数据修改成功!", vbOKOnly + vbInformation, "提示"
Me.关账 = blnBook
Me.LastSaveBy = strLastSaveBy
Me.LastSaveTime = dtmLastSaveTime
End If
End If
End Sub
Access快速开发平台QQ群 (群号:321554481) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- Access对子窗体数据进行批...(10.30)
- 最精简的组合框行来源数据快速输...(10.25)
- Access仿平台的多值选择器...(10.24)
- 【Access日期区间段查询】...(10.22)
- 【Access源码示例】VBA...(10.12)
- Access累乘示例,Acce...(10.09)
- 数值8.88,把整数8去掉,转...(10.08)
- 【Access自定义函数】一个...(09.30)
- 【Access选项卡示例】Ac...(09.09)
学习心得
最新文章
- Access判断多条明细的配方或订...(11.30)
- 如何让后台数据库在局域网共享时,且...(11.29)
- 【Access月初月末日期设置方法...(11.29)
- 【Access IIF函数嵌套示例...(11.26)
- Access快速开发平台--使用组...(11.25)
- Access快速开发平台--对上传...(11.22)
- Access快速开发平台企业版--...(11.18)
- 不会用多表联合查询,多表查询没结果...(11.16)
- 【案例分享】主键字段值含有不间断空...(11.16)
- Access快速开发平台--后台D...(11.14)