📄 form1.frm
字号:
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "合同期"
Height = 195
Index = 22
Left = 6840
TabIndex = 28
Top = 4320
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "医疗保险账号"
Height = 195
Index = 21
Left = 4680
TabIndex = 25
Top = 5520
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "银行账号"
Height = 195
Index = 20
Left = 360
TabIndex = 24
Top = 5520
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "工资类别"
Height = 195
Index = 19
Left = 6840
TabIndex = 23
Top = 3720
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "职务"
Height = 195
Index = 18
Left = 5040
TabIndex = 22
Top = 3720
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "职称"
Height = 195
Index = 17
Left = 2640
TabIndex = 21
Top = 3720
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "进入本单位时间"
Height = 195
Index = 16
Left = 0
TabIndex = 20
Top = 4920
Width = 1260
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "工龄"
Height = 195
Index = 15
Left = 5040
TabIndex = 19
Top = 4320
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "参加工作时间"
Height = 195
Index = 14
Left = 120
TabIndex = 18
Top = 4320
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "职工类型"
Height = 195
Index = 13
Left = 360
TabIndex = 17
Top = 3720
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "文化程度"
Height = 195
Index = 12
Left = 6840
TabIndex = 16
Top = 3240
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "婚姻状况"
Height = 195
Index = 11
Left = 5040
TabIndex = 15
Top = 3240
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "政治面貌"
Height = 195
Index = 10
Left = 2640
TabIndex = 14
Top = 3240
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "民族"
Height = 195
Index = 9
Left = 360
TabIndex = 13
Top = 3240
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "身份证号"
Height = 195
Index = 8
Left = 360
TabIndex = 12
Top = 2760
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "email"
Height = 195
Index = 7
Left = 5160
TabIndex = 11
Top = 2280
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "联系电话"
Height = 195
Index = 6
Left = 360
TabIndex = 10
Top = 2280
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "家庭住址"
Height = 195
Index = 5
Left = 360
TabIndex = 9
Top = 1800
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "隶属部门"
Height = 195
Index = 4
Left = 360
TabIndex = 8
Top = 1320
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "出生日期"
Height = 195
Index = 3
Left = 5040
TabIndex = 7
Top = 840
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "年龄"
Height = 195
Index = 2
Left = 3840
TabIndex = 6
Top = 840
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "性别"
Height = 195
Index = 1
Left = 2520
TabIndex = 5
Top = 840
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓名"
Height = 195
Index = 0
Left = 360
TabIndex = 4
Top = 840
Width = 360
End
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "编号"
Height = 195
Left = 2640
TabIndex = 2
Top = 120
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "职工"
Height = 195
Left = 360
TabIndex = 1
Top = 120
Width = 360
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cmd As New ADODB.Command
Dim delcmd As Boolean '标记“删除职工信息”按钮状态
Dim savecmd As Boolean '标记“保存修改信息”按钮状态
Dim cancelcmd As Boolean '标记“放弃保存返回”按钮状态
Dim exitcmd As Boolean '标记“返回退出”按钮状态
Dim rsview As New ADODB.Recordset
Dim rs_grid1 As New ADODB.Recordset 'datagrid1的recordset对象
Dim rs_grid2 As New ADODB.Recordset 'datagrid1的recordset对象
Dim rs_grid3 As New ADODB.Recordset 'datagrid1的recordset对象
Dim rs_grid4 As New ADODB.Recordset 'datagrid1的recordset对象
Dim rs_grid5 As New ADODB.Recordset 'datagrid1的recordset对象
Dim rs_grid6 As New ADODB.Recordset 'datagrid1的recordset对象
Private Sub cmdcancel_Click()
On Error GoTo commanderror
If show_arch = True And addinfo = False Then
cmd_states = True
setcmd '设置按钮状态
'关闭数据对象
rs_grid1.Close
rs_grid2.Close
rs_grid3.Close
rs_grid4.Close
rs_grid5.Close
rs_grid6.Close
viewdata '处于显示当前档案状态
Else '如果出于添加状态时按取消按钮,则直接退出窗体
Unload Me
End If
commanderror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
Private Sub cmddel_Click()
Dim answer As String
Dim sql As String
Dim rs_del As New ADODB.Recordset
On Error GoTo delerror
answer = MsgBox("确定删除整个档案记录吗?", vbYesNo, "确认删除")
If answer = vbYes Then
sql = "select * from 基本档案 where employee_NO ='" & select_row & "'"
rs_del.CursorLocation = adUseClient
rs_del.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_del.Delete
MsgBox "删除成功", vbOKOnly + vbExclamation, ""
rs_del.MoveNext '移动数据到下一条
If rs_del.RecordCount > 0 Then '判断是否为空记录
If rs_del.EOF Then '如果到达最后一条记录
rs_del.MoveLast '则移动到最后一条
End If
select_row = rs_del.Fields(0)
viewdata
End If
End If
cmd_states = True
setcmd
delerror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
Private Sub cmdexit_Click()
show_arch = False
addinfo = False
'关闭数据对象
Unload Form1
End Sub
Private Sub cmdmodify_Click() '点击修改职工档案按钮时执行的子程序
'六个datagrid控件都可以进行修改
Set DataGrid1.DataSource = rs_grid1
Set DataGrid2.DataSource = rs_grid2
Set DataGrid3.DataSource = rs_grid3
Set DataGrid4.DataSource = rs_grid4
Set DataGrid5.DataSource = rs_grid5
Set DataGrid6.DataSource = rs_grid6
With DataGrid1
.Columns("employee_NO").Visible = False
.AllowArrows = True
.AllowAddNew = True
.AllowDelete = True
.AllowUpdate = True
End With
With DataGrid2
.Columns("employee_NO").Visible = False
.AllowArrows = True
.AllowAddNew = True
.AllowDelete = True
.AllowUpdate = True
End With
With DataGrid3
.Columns("employee_NO").Visible = False
.AllowArrows = True
.AllowAddNew = True
.AllowDelete = True
.AllowUpdate = True
End With
With DataGrid4
.Columns("employee_NO").Visible = False
.AllowArrows = True
.AllowAddNew = True
.AllowDelete = True
.AllowUpdate = True
End With
With DataGrid5
.Columns("employee_NO").Visible = False
.AllowArrows = True
.AllowAddNew = True
.AllowDelete = True
.AllowUpdate = True
End With
With DataGrid6
.Columns("employee_NO").Visible = False
.AllowArrows = True
.AllowAddNew = True
.AllowDelete = True
.AllowUpdate = True
End With
Combo1.Enabled = True 'combo控件可用
Combo2.Enabled = True
Combo3.Enabled = True
Combo4.Enabled = True
Combo5.Enabled = True
cmd_states = False '修改状态等效于添加新档案状态
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -