📄 f_zhengzhaodiaoyue.frm
字号:
DataField = "调阅证照名称"
Height = 285
Index = 0
Left = 2040
TabIndex = 5
Top = 360
Width = 2175
End
Begin VB.Label lblLabels
Caption = "备注:"
Height = 255
Index = 11
Left = 240
TabIndex = 23
Top = 4500
Width = 1815
End
Begin VB.Label lblLabels
Caption = "本部门经手人:"
Height = 255
Index = 10
Left = 240
TabIndex = 21
Top = 4020
Width = 1815
End
Begin VB.Label lblLabels
Caption = "本部门经理:"
Height = 255
Index = 9
Left = 5040
TabIndex = 19
Top = 3600
Width = 1815
End
Begin VB.Label lblLabels
Caption = "归还人:"
Height = 255
Index = 8
Left = 240
TabIndex = 17
Top = 3540
Width = 1815
End
Begin VB.Label lblLabels
Caption = "归还日期:"
Height = 255
Index = 7
Left = 5040
TabIndex = 16
Top = 3120
Width = 1815
End
Begin VB.Label lblLabels
Caption = "预计使用时间:"
Height = 255
Index = 6
Left = 240
TabIndex = 14
Top = 3060
Width = 1815
End
Begin VB.Label lblLabels
Caption = "调阅人:"
Height = 255
Index = 5
Left = 5040
TabIndex = 12
Top = 2580
Width = 1815
End
Begin VB.Label lblLabels
Caption = "调阅部门经理:"
Height = 255
Index = 4
Left = 240
TabIndex = 10
Top = 2580
Width = 1815
End
Begin VB.Label lblLabels
Caption = "调阅部门:"
Height = 255
Index = 3
Left = 5040
TabIndex = 9
Top = 2100
Width = 1815
End
Begin VB.Label lblLabels
Caption = "调阅时间:"
Height = 255
Index = 2
Left = 240
TabIndex = 8
Top = 2085
Width = 1815
End
Begin VB.Label lblLabels
Caption = "调阅原因:"
Height = 255
Index = 1
Left = 240
TabIndex = 6
Top = 960
Width = 1815
End
Begin VB.Label lblLabels
Caption = "调阅证照名称:"
Height = 255
Index = 0
Left = 240
TabIndex = 4
Top = 360
Width = 1815
End
End
End
End
End
Attribute VB_Name = "F_ZhengZhaoDiaoYue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents adoPrimaryRS As Recordset
Attribute adoPrimaryRS.VB_VarHelpID = -1
Dim mbChangedByCode As Boolean
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Private Sub Form_Load()
On Error Resume Next
For Each TextBox In Me.Controls
Next
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select 调阅证照名称,调阅原因,调阅时间,调阅部门,调阅部门经理,调阅人,预计使用时间,归还日期,归还人,本部门经理,本部门经手人,备注 from 证照调阅 Order by 调阅证照名称", db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = adoPrimaryRS
SetButtons True
Set DTPicker1.DataSource = adoPrimaryRS
Set DTPicker2.DataSource = adoPrimaryRS
Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
Set Combo1.DataSource = adoPrimaryRS
Dim SqlBuMen As String
SqlBuMen = "select distinct 部门名称 from 部门维护表"
Set RsBuMen = db.Execute(SqlBuMen)
While Not RsBuMen.EOF
Combo1.AddItem Trim(RsBuMen("部门名称"))
RsBuMen.MoveNext
Wend
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub cmdAdd_Click()
On Error GoTo AddErr
With adoPrimaryRS
If Not (.BOF And .EOF) Then
mvBookMark = .Bookmark
End If
.AddNew
mbAddNewFlag = True
SetButtons False
End With
Exit Sub
AddErr:
MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With adoPrimaryRS
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdRefresh_Click()
'This is only needed for multi user apps
On Error GoTo RefreshErr
adoPrimaryRS.Requery
Exit Sub
RefreshErr:
MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdEdit_Click()
On Error GoTo EditErr
mbEditFlag = True
SetButtons False
Exit Sub
EditErr:
MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdCancel_Click()
' On Error Resume Next
On Error GoTo CancelErr
mbEditFlag = False
mbAddNewFlag = False
adoPrimaryRS.CancelUpdate
If mvBookMark > 0 Then
adoPrimaryRS.Bookmark = mvBookMark
Else
adoPrimaryRS.MoveFirst
End If
SetButtons True
Exit Sub
CancelErr:
MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
adoPrimaryRS.UpdateBatch adAffectAll
If mbAddNewFlag Then
adoPrimaryRS.MoveLast 'move to the new record
End If
mbEditFlag = False
mbAddNewFlag = False
SetButtons True
Exit Sub
UpdateErr:
MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdClose_Click()
ZhengZhaoGuanli.Enabled = True
Unload Me
End Sub
Private Sub SetButtons(bVal As Boolean)
Dim oText As TextBox
cmdAdd.Visible = bVal
cmdEdit.Visible = bVal
cmdUpdate.Visible = Not bVal
cmdCancel.Visible = Not bVal
cmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
If bVal Then
Set DataGrid1.DataSource = adoPrimaryRS
Else
Set DataGrid1.DataSource = Nothing
End If
For Each oText In Me.txtFields
oText.Enabled = Not bVal
Next
Combo1.Enabled = Not bVal
DTPicker1.Enabled = Not bVal
DTPicker2.Enabled = Not bVal
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -