📄 frmcq.frm
字号:
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 5
Left = 120
TabIndex = 13
Top = 240
Width = 1815
End
End
Begin VB.Frame Frame2
Caption = "时间"
Height = 975
Left = 120
TabIndex = 7
Top = 3840
Width = 9975
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 7560
TabIndex = 51
Top = 360
Width = 2175
End
Begin VB.TextBox txtFields
DataField = "月份"
Height = 350
Index = 4
Left = 4200
TabIndex = 11
Top = 360
Width = 2055
End
Begin VB.TextBox txtFields
DataField = "年份"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Index = 3
Left = 840
TabIndex = 9
Top = 360
Width = 2415
End
Begin VB.Label Label1
Caption = "当前时间:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6480
TabIndex = 50
Top = 360
Width = 1455
End
Begin VB.Label lblLabels
Caption = "月份:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 4
Left = 3480
TabIndex = 10
Top = 360
Width = 1815
End
Begin VB.Label lblLabels
Caption = "年份:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 120
TabIndex = 8
Top = 360
Width = 1815
End
End
Begin VB.Frame Frame1
Caption = "员工信息"
Height = 855
Left = 120
TabIndex = 0
Top = 240
Width = 9975
Begin VB.TextBox txtFields
DataField = "所属部门"
DataSource = "Adodc1"
Height = 350
Index = 2
Left = 7680
TabIndex = 6
Top = 285
Width = 2055
End
Begin VB.TextBox txtFields
DataField = "员工姓名"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Index = 1
Left = 4680
TabIndex = 4
Top = 315
Width = 1575
End
Begin VB.TextBox txtFields
DataField = "员工编号"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Index = 0
Left = 1320
TabIndex = 2
Top = 360
Width = 1935
End
Begin VB.Label lblLabels
Caption = "所属部门:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 6480
TabIndex = 5
Top = 285
Width = 1815
End
Begin VB.Label lblLabels
Caption = "员工姓名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 3480
TabIndex = 3
Top = 315
Width = 1815
End
Begin VB.Label lblLabels
Caption = "员工编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 120
TabIndex = 1
Top = 360
Width = 1815
End
End
Begin MSAdodcLib.Adodc datPrimaryRS
Height = 330
Left = 120
Top = 6840
Visible = 0 'False
Width = 5280
_ExtentX = 9313
_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 = " "
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 = "frmCQ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim money As Integer
For i = 0 To 10
If txtFields(i).Text = "" Then
MsgBox "输入的数据不完整!"
txtFields(i).SetFocus
Exit Sub
End If
Next i
money = Val(txtFields(22).Text) + Val(txtFields(21).Text * txtFields(20).Text) + Val(txtFields(19).Text) + Val(txtFields(18).Text) + Val(txtFields(17).Text) + Val(txtFields(16).Text) * Val(txtFields(9).Text) - Val(txtFields(14).Text) * Val(txtFields(7).Text) - Val(txtFields(12).Text) * Val(txtFields(8).Text) + Val(txtFields(5).Text) - Val(txtFields(6).Text) + Val(txtFields(10).Text)
MsgBox "该职工本月工资实发额应为" & CStr(money)
Adodc2.ConnectionString = constr
Adodc2.RecordSource = "select * from 历史记录 where 员工编号 like " & Trim(txtFields(0).Text) & " and 年份 like " & Trim(txtFields(3).Text) & " and 月份 like " & Trim(txtFields(4).Text)
Adodc2.Refresh
If Adodc2.Recordset.RecordCount <> 0 Then
MsgBox "当前职工当月工资已发,请查核!"
Exit Sub
End If
If MsgBox("保存当前操作吗吗?", vbInformation + vbYesNo, "添加工资记录?") = vbYes Then
datPrimaryRS.Recordset.AddNew
datPrimaryRS.Recordset(0) = Text1.Text
datPrimaryRS.Recordset(1) = txtFields(0).Text
datPrimaryRS.Recordset(2) = txtFields(1).Text
datPrimaryRS.Recordset(3) = txtFields(2).Text
datPrimaryRS.Recordset(4) = txtFields(3).Text
datPrimaryRS.Recordset(5) = txtFields(4).Text
datPrimaryRS.Recordset(6) = txtFields(8).Text
datPrimaryRS.Recordset(7) = txtFields(7).Text
datPrimaryRS.Recordset(8) = txtFields(9).Text
datPrimaryRS.Recordset(9) = txtFields(5).Text
datPrimaryRS.Recordset(10) = txtFields(6).Text
datPrimaryRS.Recordset(11) = txtFields(10).Text
datPrimaryRS.Recordset(12) = txtFields(11).Text
datPrimaryRS.Recordset.UpdateBatch
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
MsgBox "已经到达最后一位职工。"
Unload Me
Else
txtFields(3).Text = ""
txtFields(4).Text = ""
Text1.Text = Date
txtFields(5).Text = ""
txtFields(6).Text = ""
txtFields(7).Text = ""
txtFields(8).Text = ""
txtFields(9).Text = ""
txtFields(10).Text = ""
txtFields(11).Text = ""
End If
End If
End Sub
Private Sub Command2_Click()
If MsgBox("放弃当前操作吗吗?", vbInformation + vbYesNo, "取消?") = vbYes Then
Unload Me
End If
End Sub
Private Sub Form_Load()
Adodc2.ConnectionString = constr
Adodc2.RecordSource = "select * from 历史记录 Order by 员工编号"
Adodc2.Refresh
datPrimaryRS.ConnectionString = constr
datPrimaryRS.RecordSource = "select * from 历史记录 Order by 员工编号"
datPrimaryRS.Refresh
Adodc1.ConnectionString = constr
Adodc1.RecordSource = "select * from 基本工资表 Order by 员工编号"
Adodc1.Refresh
txtFields(3).Text = ""
txtFields(4).Text = ""
Text1.Text = Date
txtFields(5).Text = ""
txtFields(6).Text = ""
txtFields(7).Text = ""
txtFields(8).Text = ""
txtFields(9).Text = ""
txtFields(10).Text = ""
txtFields(11).Text = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub datPrimaryRS_Error(ByVal ErrorNumber As Long, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, fCancelDisplay As Boolean)
'错误处理程序代码置于此处
'想要忽略错误,注释掉下一行
'想要捕获它们,在此添加代码以处理它们
MsgBox "Data error event hit err:" & Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -