📄 main_rsgl_bxgl_lr.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form main_rsgl_bxgl_lr
BorderStyle = 3 'Fixed Dialog
ClientHeight = 2010
ClientLeft = 45
ClientTop = 330
ClientWidth = 6960
Icon = "main_rsgl_bxgl_lr.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2010
ScaleWidth = 6960
ShowInTaskbar = 0 'False
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 360
Left = 3465
TabIndex = 8
Top = 1455
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 360
Left = 2100
TabIndex = 7
Top = 1455
Width = 1095
End
Begin VB.Frame Frame1
Height = 1335
Left = 15
TabIndex = 0
Top = -60
Width = 6930
Begin MSComCtl2.DTPicker DTPicker1
Height = 330
Left = 4425
TabIndex = 9
Top = 750
Width = 2400
_ExtentX = 4233
_ExtentY = 582
_Version = 393216
Format = 59768833
CurrentDate = 39448
End
Begin VB.TextBox txt1
Height = 330
Left = 990
TabIndex = 3
Top = 300
Width = 2400
End
Begin VB.TextBox txt3
Height = 330
Left = 990
TabIndex = 2
Top = 720
Width = 2400
End
Begin VB.TextBox txt2
Height = 330
Left = 4425
TabIndex = 1
Top = 300
Width = 2400
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "所属月份:"
Height = 255
Left = 3480
TabIndex = 10
Top = 795
Width = 1080
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "养老保险:"
Height = 255
Left = 90
TabIndex = 6
Top = 390
Width = 930
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "失业保险:"
Height = 255
Left = 3480
TabIndex = 5
Top = 375
Width = 975
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "医疗保险:"
Height = 255
Left = 105
TabIndex = 4
Top = 810
Width = 1080
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 0
Top = 0
Visible = 0 'False
Width = 2040
_ExtentX = 3598
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
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
End
Attribute VB_Name = "main_rsgl_bxgl_lr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Private Sub Form_Activate()
txt1.SetFocus
End Sub
Private Sub Form_Load()
If blnAddBX = True Then
Me.Caption = "福利信息添加"
Else
Me.Caption = "福利信息修改"
With main_rsgl_bxgl.Adodc1.Recordset
If .RecordCount > 0 Then
txt1 = .Fields("养老保险")
txt2 = .Fields("失业保险")
txt3 = .Fields("医疗保险")
DTPicker1.Value = .Fields("所属月份")
End If
End With
End If
End Sub
Private Sub cmdOK_Click()
If IsNumeric(txt1) = False Or IsNumeric(txt2) = False Or IsNumeric(txt3) = False Then
MsgBox "请输入数值型数据!"
Exit Sub
End If
If blnAddBX = True Then
With main_rsgl_bxgl
rs.Open "select * from 员工福利表", cnn, adOpenKeyset, adLockOptimistic
For i = 0 To .lstEmployee.ListCount - 1
If .lstEmployee.Selected(i) = True Then
rs.AddNew
rs.Fields("员工编号") = Left(.lstEmployee.List(i), 5)
rs.Fields("员工姓名") = Mid(.lstEmployee.List(i), 6, Len(.lstEmployee.List(i)))
rs.Fields("养老保险") = txt1.Text
rs.Fields("失业保险") = txt2.Text
rs.Fields("医疗保险") = txt3.Text
rs.Fields("所属月份") = Str(Year(DTPicker1.Value)) & "-" & Format(Month(DTPicker1.Value), "00")
rs.Update
End If
Next i
rs.Close
.Adodc1.Refresh
End With
Else
With main_rsgl_bxgl
rs.Open "select * from 员工福利表 where 员工编号='" + .Adodc1.Recordset.Fields("员工编号") + "'", cnn, adOpenKeyset, adLockOptimistic
If rs.RecordCount > 0 Then
rs.Fields("养老保险") = txt1.Text
rs.Fields("失业保险") = txt2.Text
rs.Fields("医疗保险") = txt3.Text
rs.Fields("所属月份") = Str(Year(DTPicker1.Value)) & "-" & Format(Month(DTPicker1.Value), "00")
rs.Update
rs.Close
End If
.Adodc1.Refresh
End With
End If
Unload Me
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -