📄 main_jypx_lr.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form main_jypx_lr
BackColor = &H00D0E8EE&
BorderStyle = 1 'Fixed Single
Caption = "教育培训信息录入窗口"
ClientHeight = 4545
ClientLeft = 45
ClientTop = 330
ClientWidth = 6495
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4545
ScaleWidth = 6495
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton CmdSave
BackColor = &H00FFC0C0&
Caption = "保存"
Height = 390
Left = 3045
Style = 1 'Graphical
TabIndex = 13
Top = 4080
Width = 1650
End
Begin VB.CommandButton CmdEnd
BackColor = &H00FFC0C0&
Caption = "返回"
Height = 390
Left = 4740
Style = 1 'Graphical
TabIndex = 12
Top = 4080
Width = 1650
End
Begin VB.Frame Frame1
BackColor = &H00D0E8EE&
Height = 3375
Left = 90
TabIndex = 0
Top = 630
Width = 6330
Begin VB.TextBox Text1
Height = 330
Index = 8
Left = 1110
ScrollBars = 1 'Horizontal
TabIndex = 11
Top = 2910
Width = 5070
End
Begin VB.TextBox Text1
Height = 330
Index = 7
Left = 1110
TabIndex = 10
Top = 2385
Width = 5070
End
Begin VB.TextBox Text1
Height = 330
Index = 6
Left = 1110
TabIndex = 9
Top = 1830
Width = 5070
End
Begin VB.TextBox Text1
Height = 330
Index = 5
Left = 1095
TabIndex = 8
Top = 1290
Width = 5070
End
Begin VB.TextBox Text1
Height = 330
Index = 4
Left = 4050
TabIndex = 7
Top = 765
Width = 2130
End
Begin VB.TextBox Text1
Height = 330
Index = 3
Left = 1110
Locked = -1 'True
TabIndex = 6
Top = 765
Width = 1860
End
Begin VB.TextBox Text1
Height = 330
Index = 2
Left = 4065
Locked = -1 'True
TabIndex = 5
Top = 195
Width = 2115
End
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "main_jypx_lr.frx":0000
Height = 330
Left = 1110
TabIndex = 4
Top = 180
Width = 1845
_ExtentX = 3254
_ExtentY = 582
_Version = 393216
ListField = "工号"
Text = ""
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "备 注:"
Height = 225
Left = 195
TabIndex = 14
Top = 2970
Width = 930
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "培训费用:"
Height = 225
Left = 195
TabIndex = 3
Top = 2460
Width = 5175
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "培训成绩:"
Height = 225
Left = 195
TabIndex = 2
Top = 1905
Width = 1050
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = $"main_jypx_lr.frx":0015
Height = 1425
Left = 195
TabIndex = 1
Top = 285
Width = 4380
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 0
Top = 0
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
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 = ""
OLEDBString = ""
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.Label Label10
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
BorderStyle = 1 'Fixed Single
Caption = " 教育培训信息录入"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 375
Left = 1650
TabIndex = 15
Top = 150
Width = 3270
End
End
Attribute VB_Name = "main_jypx_lr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub CmdSave_Click()
rs1.Open "select * from 教育培训信息表", Cnn, adOpenKeyset, adLockOptimistic
rs1.AddNew
rs1.Fields("工号") = DataCombo1.Text
For i = 2 To 4
rs1.Fields(i) = Text1(i).Text
Next i
rs1.Fields("培训时间") = Val(Text1(5).Text)
rs1.Fields("培训成绩") = Text1(6).Text
rs1.Fields("培训费用") = Val(Text1(7).Text)
rs1.Fields("备注") = Text1(8).Text
rs1.Update
main_jypx.Adodc1.Refresh
'关闭数据集对象
rs1.Close
Unload Me
End Sub
Private Sub DataCombo1_Change()
rs1.Open "select * from 人事档案信息表 where 工号='" + DataCombo1.Text + "'", Cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
Text1(2).Text = rs1.Fields("姓名")
Text1(3).Text = rs1.Fields("部门名称")
End If
rs1.Close
End Sub
Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(4).SetFocus
End Sub
Private Sub Form_Activate()
DataCombo1.SetFocus
Adodc1.ConnectionString = Cnn
Adodc1.RecordSource = "select * from 人事档案信息表 where 员工状态='在职'"
Adodc1.Refresh
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If Index < 8 And KeyCode = vbKeyReturn Then Text1(Index + 1).SetFocus
If Index = 8 And KeyCode = vbKeyReturn Then CmdSave.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub CmdEnd_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -