📄 frmduty.frm
字号:
TabIndex = 25
Top = 2004
Width = 1095
End
Begin VB.Label lblLabels
Caption = "其他假说明:"
Height = 255
Index = 8
Left = 4080
TabIndex = 24
Top = 2492
Width = 1215
End
Begin VB.Label lblLabels
Caption = "其他假天数:"
Height = 255
Index = 9
Left = 360
TabIndex = 23
Top = 2980
Width = 1215
End
Begin VB.Label lblLabels
Caption = "旷工天数:"
Height = 255
Index = 10
Left = 4080
TabIndex = 22
Top = 3960
Width = 975
End
Begin VB.Label lblLabels
Caption = "延时加班小时:"
Height = 255
Index = 11
Left = 4080
TabIndex = 21
Top = 2980
Width = 1335
End
Begin VB.Label lblLabels
Caption = "休息日加班小时:"
Height = 255
Index = 12
Left = 360
TabIndex = 20
Top = 3468
Width = 1455
End
Begin VB.Label lblLabels
Caption = "休假日加班小时:"
Height = 255
Index = 13
Left = 4080
TabIndex = 19
Top = 3468
Width = 1575
End
Begin VB.Label lblLabels
Caption = "迟到早退次数:"
Height = 255
Index = 14
Left = 360
TabIndex = 18
Top = 3960
Width = 1335
End
Begin VB.Label lblLabels
Caption = "应出勤天数:"
Height = 255
Index = 15
Left = 360
TabIndex = 17
Top = 2004
Width = 1095
End
End
End
Attribute VB_Name = "frmAddDuty"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub txtFields_LostFocus(Index As Integer)
Dim msgstr As String
If Index = 3 Then
Dim Sql3 As String
Sql3 = "select distinct 部门,姓名 from 员工基本信息 where 员工号 = '" & txtFields(3).Text & "'"
Set rs3 = ExecuteSQL(Sql3, msgstr)
If Not rs3.BOF And Not rs3.EOF Then
If Not IsNull(rs3("部门")) Then
txtFields(2).Text = Trim(rs3("部门"))
End If
If Not IsNull(rs3("姓名")) Then
txtFields(4).Text = Trim(rs3("姓名"))
End If
End If
End If
If Not IsNumeric(txtFields(0).Text) And (txtFields(0).Text <> "") Then
MsgBox "请在“年度”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(0).SetFocus
txtFields(0).SelLength = Len(txtFields(0))
txtFields(0).SelStart = 0
End If
MsgBox "请在“月份”中输入数字", vbExclamation + vbOKOnly, pTitle
If Not IsNumeric(txtFields(1).Text) And (txtFields(1).Text <> "") Then
txtFields(1).SetFocus
txtFields(1).SelLength = Len(txtFields(1))
txtFields(1).SelStart = 0
End If
If Not IsNumeric(txtFields(5).Text) And (txtFields(5).Text <> "") Then
MsgBox "请在“全勤”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(5).SetFocus
txtFields(5).SelLength = Len(txtFields(5))
txtFields(5).SelStart = 0
End If
If Not IsNumeric(txtFields(6).Text) And (txtFields(6).Text <> "") Then
MsgBox "请在“病假”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(6).SetFocus
txtFields(6).SelLength = Len(txtFields(6))
txtFields(6).SelStart = 0
End If
If Not IsNumeric(txtFields(7).Text) And (txtFields(7).Text <> "") Then
MsgBox "请在“事假”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(7).SetFocus
txtFields(7).SelLength = Len(txtFields(7))
txtFields(7).SelStart = 0
End If
If Not IsNumeric(txtFields(9).Text) And (txtFields(9).Text <> "") Then
MsgBox "请在“其他假时间”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(9).SetFocus
txtFields(9).SelLength = Len(txtFields(9))
txtFields(9).SelStart = 0
End If
If Not IsNumeric(txtFields(10).Text) And (txtFields(10).Text <> "") Then
MsgBox "请在“旷工时间”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(10).SetFocus
txtFields(10).SelLength = Len(txtFields(10))
txtFields(10).SelStart = 0
End If
If Not IsNumeric(txtFields(11).Text) And (txtFields(11).Text <> "") Then
MsgBox "请在“延时加班时间”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(11).SetFocus
txtFields(11).SelLength = Len(txtFields(11))
txtFields(11).SelStart = 0
End If
If Not IsNumeric(txtFields(12).Text) And (txtFields(12).Text <> "") Then
MsgBox "请在“休息日加班时间”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(12).SetFocus
txtFields(12).SelLength = Len(txtFields(12))
txtFields(12).SelStart = 0
End If
If Not IsNumeric(txtFields(13).Text) And (txtFields(13).Text <> "") Then
MsgBox "请在“休假日加班时间”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(13).SetFocus
txtFields(13).SelLength = Len(txtFields(13))
txtFields(13).SelStart = 0
End If
If Not IsNumeric(txtFields(14).Text) And (txtFields(14).Text <> "") Then
MsgBox "请在“迟到早退次数”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(14).SetFocus
txtFields(14).SelLength = Len(txtFields(14))
txtFields(14).SelStart = 0
End If
If Not IsNumeric(txtFields(15).Text) And (txtFields(15).Text <> "") Then
MsgBox "请在“应出勤天数”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(15).SetFocus
txtFields(15).SelLength = Len(txtFields(15))
txtFields(15).SelStart = 0
End If
End Sub
Private Sub cmdSave_Click()
Dim adoshowrsJL As ADODB.Recordset
Dim msgstr As String
If txtFields(3).Text <> "" And IsNumeric(txtFields(0).Text) And IsNumeric(txtFields(1).Text) Then
SqlJL = "SELECT * From 考勤信息 Where 员工号 ='" & txtFields(3).Text & "' " & " and 年度 = " & txtFields(0).Text & " and 月份 = " & txtFields(1).Text
Else
MsgBox "请输入正确的员工号、年度和月份信息!", vbExclamation + vbOKOnly, "信息框"
Exit Sub
End If
Set adoshowrsJL = ExecuteSQL(SqlJL, msgstr)
'adoshowrsJL.Open SqlJL, db, adOpenStatic, adLockOptimistic
'adoshowrsJL.Requery
If Not adoshowrsJL.BOF And Not adoshowrsJL.EOF Then
MsgBox "此员工的本年月考勤已存在,请输入新的员工考勤!", vbExclamation + vbOKOnly, "信息框"
Exit Sub
End If
Dim txtSQL As String
Dim mrcc As ADODB.Recordset
txtSQL = "select * from 考勤信息"
Set mrcc = ExecuteSQL(txtSQL, msgstr)
mrcc.AddNew
mrcc.Fields(1) = Val(txtFields(0).Text)
mrcc.Fields(2) = Val(txtFields(1).Text)
mrcc.Fields(3) = Trim(txtFields(2).Text)
mrcc.Fields(4) = Trim(txtFields(3).Text)
mrcc.Fields(5) = Trim(txtFields(4).Text)
mrcc.Fields(6) = Val(txtFields(15).Text)
mrcc.Fields(7) = Val(txtFields(5).Text)
mrcc.Fields(8) = Val(txtFields(6).Text)
mrcc.Fields(9) = Val(txtFields(7).Text)
mrcc.Fields(10) = Val(txtFields(14).Text)
mrcc.Fields(11) = Val(txtFields(8).Text)
mrcc.Fields(12) = Val(txtFields(9).Text)
mrcc.Fields(13) = Val(txtFields(10).Text)
mrcc.Fields(14) = Val(txtFields(11).Text)
mrcc.Fields(15) = Val(txtFields(12).Text)
mrcc.Fields(16) = Val(txtFields(13).Text)
mrcc.Update
MsgBox "考勤信息添加成功!", vbOKOnly + vbExclamation, "添加房屋资料信息"
mrcc.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -