📄 form9.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form9
Caption = "职务变动录入"
ClientHeight = 6045
ClientLeft = 60
ClientTop = 345
ClientWidth = 8565
LinkTopic = "Form9"
ScaleHeight = 6045
ScaleWidth = 8565
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 840
Top = 5160
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=RSGL.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=RSGL.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 495
Left = 6600
TabIndex = 18
Top = 5520
Width = 1455
End
Begin VB.Frame Frame2
Caption = "职务变动"
Height = 2535
Left = 360
TabIndex = 9
Top = 2760
Width = 7695
Begin VB.CommandButton Command3
Caption = "保存记录"
Height = 615
Left = 5880
TabIndex = 19
Top = 1800
Width = 1455
End
Begin VB.TextBox Text4
Height = 495
Left = 5520
TabIndex = 17
Top = 1200
Width = 1455
End
Begin VB.TextBox Text3
Height = 495
Left = 2040
TabIndex = 15
Top = 1200
Width = 1335
End
Begin VB.TextBox Text2
Height = 495
Left = 5520
TabIndex = 13
Top = 360
Width = 1455
End
Begin VB.TextBox Text1
Height = 495
Left = 2040
TabIndex = 11
Top = 360
Width = 1335
End
Begin VB.Label Label7
Caption = "开始时间"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3840
TabIndex = 16
Top = 1200
Width = 1335
End
Begin VB.Label Label6
Caption = "现职务名称"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 14
Top = 1200
Width = 1215
End
Begin VB.Label Label5
Caption = "开始时间"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3840
TabIndex = 12
Top = 360
Width = 1215
End
Begin VB.Label Label4
Caption = "原职务名称"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 10
Top = 360
Width = 1335
End
End
Begin VB.Frame Frame1
Caption = "选择记录"
Height = 1695
Left = 360
TabIndex = 1
Top = 960
Width = 7695
Begin VB.CommandButton Command1
Caption = "确 定"
Height = 495
Left = 5640
TabIndex = 8
Top = 600
Width = 1455
End
Begin VB.ComboBox Combo2
Height = 300
Left = 3120
Style = 2 'Dropdown List
TabIndex = 7
Top = 1080
Width = 1455
End
Begin VB.ComboBox Combo1
Height = 300
Left = 3120
Style = 2 'Dropdown List
TabIndex = 6
Top = 360
Width = 1455
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 300
Left = 240
TabIndex = 3
Top = 1080
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 300
Left = 240
TabIndex = 2
Top = 360
Value = -1 'True
Width = 255
End
Begin VB.Label Label2
Caption = "人员姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 840
TabIndex = 5
Top = 360
Width = 975
End
Begin VB.Label Label3
Caption = "人员编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 840
TabIndex = 4
Top = 1080
Width = 1095
End
End
Begin VB.Label Label1
Caption = "先选择职务变动的人员,再录入信息"
BeginProperty Font
Name = "幼圆"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 495
Left = 1440
TabIndex = 0
Top = 240
Width = 4935
End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Option2.Value = True Then
Adodc1.RecordSource = "select * from 人事基本信息表 where 人员编号='" & Combo2.Text & "'"
Adodc1.Refresh
If Not IsNull(Adodc1.Recordset.Fields("职务名称")) Then
Text1.Text = Adodc1.Recordset.Fields("职务名称")
Text2.Text = Adodc1.Recordset.Fields("任命时间")
End If
Else
Adodc1.RecordSource = "select * from 人事基本信息表 where 人员姓名='" & Combo1.Text & "'"
Adodc1.Refresh
If Not IsNull(Adodc1.Recordset.Fields("职务名称")) Then
Text1.Text = Adodc1.Recordset.Fields("职务名称")
Text2.Text = Adodc1.Recordset.Fields("任命时间")
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Adodc1.Recordset.Fields("职务名称") = Text3.Text
Adodc1.Recordset.Fields("开始时间") = Text4.Text
ming = Adodc1.Recordset.Fields("人员姓名")
bianhao = Adodc1.Recordset.Fields("人员编号")
Adodc1.Recordset.Update
Adodc1.Recordset.Close
'把改动后的信息保存在人事基本信息表里
Adodc1.RecordSource = "select * from 职务变动表 where 人员编号='" & bianhao & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.AddNew
End If
Adodc1.Recordset.Fields("人员编号") = bianhao
Adodc1.Recordset.Fields("人员姓名") = ming
Adodc1.Recordset.Fields("开始时间") = Text2.Text
Adodc1.Recordset.Fields("结束时间") = Text4.Text
Adodc1.Recordset.Fields("原职务名称") = Text1.Text
Adodc1.Recordset.Fields("现职务名称") = Text3.Text
Adodc1.Recordset.Update
'把改动后的信息保存在职务变动表里
a = MsgBox("记录已保存!", , "成功!")
End Sub
Private Sub Form_Load()
Form9.Left = 1000
Form9.Top = 1000
Adodc1.RecordSource = "select * from 人事基本信息表"
Adodc1.Refresh
While Not Adodc1.Recordset.EOF
Combo1.AddItem Adodc1.Recordset.Fields("人员姓名")
Adodc1.Recordset.MoveNext
Wend
Combo1.ListIndex = 0
Adodc1.RecordSource = "select * from 人事基本信息表"
Adodc1.Refresh
While Not Adodc1.Recordset.EOF
Combo2.AddItem Adodc1.Recordset.Fields("人员编号")
Adodc1.Recordset.MoveNext
Wend
Combo1.ListIndex = 0
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
Combo2.Enabled = False
Combo1.Enabled = True
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
Combo1.Enabled = False
Combo2.Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -