📄 kaoqinxinxi.frm
字号:
VERSION 5.00
Begin VB.Form kaoqinxinxi
Caption = "考勤信息"
ClientHeight = 5685
ClientLeft = 60
ClientTop = 345
ClientWidth = 7470
Icon = "kaoqinxinxi.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5685
ScaleWidth = 7470
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame5
Height = 735
Left = 0
TabIndex = 33
Top = 4920
Width = 7455
Begin VB.TextBox Text12
Height = 300
Left = 1080
TabIndex = 36
Top = 240
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 5760
TabIndex = 35
Top = 240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "保存"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 34
Top = 240
Width = 1095
End
Begin VB.Label Label17
Caption = "编码:"
Height = 255
Left = 480
TabIndex = 37
Top = 240
Width = 495
End
End
Begin VB.Frame Frame4
Caption = "出勤信息"
Height = 1455
Left = 0
TabIndex = 20
Top = 3360
Width = 7455
Begin VB.TextBox Text11
Height = 300
Left = 5760
TabIndex = 32
Top = 960
Width = 1215
End
Begin VB.TextBox Text10
Height = 300
Left = 3480
TabIndex = 30
Top = 960
Width = 1215
End
Begin VB.TextBox Text9
Height = 300
Left = 1200
TabIndex = 28
Top = 960
Width = 1215
End
Begin VB.TextBox Text8
Height = 300
Left = 5760
TabIndex = 26
Top = 360
Width = 1215
End
Begin VB.TextBox Text7
Height = 300
Left = 3480
TabIndex = 24
Top = 360
Width = 1215
End
Begin VB.TextBox Text6
Height = 300
Left = 1200
TabIndex = 22
Top = 360
Width = 1215
End
Begin VB.Label Label16
Caption = "出差时间:"
Height = 255
Left = 4920
TabIndex = 31
Top = 960
Width = 855
End
Begin VB.Label Label15
Caption = "加班时间:"
Height = 255
Left = 2640
TabIndex = 29
Top = 960
Width = 855
End
Begin VB.Label Label14
Caption = "迟到时间:"
Height = 255
Left = 360
TabIndex = 27
Top = 960
Width = 975
End
Begin VB.Label Label13
Caption = "早退时间:"
Height = 255
Left = 4920
TabIndex = 25
Top = 360
Width = 855
End
Begin VB.Label Label12
Caption = "请假时间:"
Height = 255
Left = 2640
TabIndex = 23
Top = 360
Width = 855
End
Begin VB.Label Label11
Caption = "旷工时间:"
Height = 255
Left = 360
TabIndex = 21
Top = 360
Width = 855
End
End
Begin VB.Frame Frame3
Caption = "调整工资"
Height = 855
Left = 0
TabIndex = 15
Top = 2400
Width = 7455
Begin VB.TextBox Text5
Height = 300
Left = 5040
TabIndex = 19
Top = 360
Width = 2000
End
Begin VB.TextBox Text4
Height = 300
Left = 1320
TabIndex = 17
Top = 360
Width = 2000
End
Begin VB.Label Label10
Caption = "扣考核:"
Height = 255
Left = 3840
TabIndex = 18
Top = 360
Width = 735
End
Begin VB.Label Label9
Caption = "加班费:"
Height = 255
Left = 360
TabIndex = 16
Top = 360
Width = 735
End
End
Begin VB.Frame Frame2
Caption = "本月基本信息"
Height = 1335
Left = 0
TabIndex = 5
Top = 960
Width = 7455
Begin VB.ComboBox Combo3
Height = 300
Left = 1200
TabIndex = 39
Top = 360
Width = 1095
End
Begin VB.ComboBox Combo4
Height = 300
Left = 2640
TabIndex = 38
Top = 360
Width = 735
End
Begin VB.TextBox Text3
Height = 375
Left = 5160
TabIndex = 14
Top = 840
Width = 1815
End
Begin VB.TextBox Text2
Height = 270
Left = 1200
TabIndex = 12
Top = 840
Width = 2175
End
Begin VB.TextBox Text1
Height = 300
Left = 5160
TabIndex = 10
Top = 360
Width = 1815
End
Begin VB.Label Label8
Caption = "应出勤天数:"
Height = 255
Left = 3960
TabIndex = 13
Top = 840
Width = 1095
End
Begin VB.Label Label7
Caption = "公休天数:"
Height = 255
Left = 360
TabIndex = 11
Top = 840
Width = 855
End
Begin VB.Label Label6
Caption = "本月天数:"
Height = 255
Left = 4080
TabIndex = 9
Top = 360
Width = 855
End
Begin VB.Label Label5
Caption = "月"
Height = 255
Left = 3480
TabIndex = 8
Top = 360
Width = 255
End
Begin VB.Label Label4
Caption = "年"
Height = 255
Left = 2400
TabIndex = 7
Top = 360
Width = 255
End
Begin VB.Label Label3
Caption = "考勤年月:"
Height = 255
Left = 360
TabIndex = 6
Top = 360
Width = 1095
End
End
Begin VB.Frame Frame1
Caption = "员工信息"
Height = 855
Left = 0
TabIndex = 0
Top = 0
Width = 7455
Begin VB.ComboBox Combo1
Height = 300
Index = 1
Left = 5160
TabIndex = 4
Top = 360
Width = 1815
End
Begin VB.ComboBox Combo1
Height = 300
Index = 0
Left = 1800
TabIndex = 2
Top = 360
Width = 1575
End
Begin VB.Label Label2
Caption = "姓名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4200
TabIndex = 3
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "部门:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 840
TabIndex = 1
Top = 360
Width = 735
End
End
End
Attribute VB_Name = "kaoqinxinxi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim rs As Recordset
Dim a As String
Private Sub Combo1_Click(Index As Integer) 'OK
Set db = OpenDatabase(App.Path & "\员工基本信息")
Set rs = db.OpenRecordset("员工基本信息")
Set rs = db.OpenRecordset("select 姓名 from 员工基本信息 where 部门 ='" & Trim(Combo1(0)) & "'")
Dim i As String
Dim t As Integer
If Index = 0 Then
Combo1(1).Clear
If Not rs.EOF Then
With Combo1(1)
Do While Not rs.EOF
.AddItem Trim(rs!姓名)
rs.MoveNext
Loop
ListIndex = 0
End With
Command1.Enabled = True
Else
MsgBox "请先建立员工档案!", vbOKOnly + vbExclamation, "jinggao"
Command1.Enabled = False
Exit Sub
End If
ElseIf Index = 1 Then
rs.MoveFirst
rs.Move Combo1(1).ListIndex
End If
Set rs = db.OpenRecordset("select 编号 from 员工基本信息 where 部门 ='" & Trim(Combo1(0)) & "' and 姓名='" & Trim(Combo1(1)) & "'")
If Not rs.EOF Then
Text12 = rs.Fields(0)
End If
End Sub
Private Sub Combo2_Change()
End Sub
Private Sub Command1_Click()
Dim db As Database
Dim rs As Recordset
Dim intcount As Integer
Dim a As String
Dim b As String
Set db = OpenDatabase(App.Path & "\考勤信息")
Set rs = db.OpenRecordset("考勤信息")
a = "select * from 考勤信息 where 部门='" & Combo1(0).Text & "' and 姓名='" & Combo1(1).Text & "' and 考勤年月= '" & Format(Combo3.Text & "-" & Combo4.Text & "-01", "yyyy-mm-dd") & "'"
'判断添加是否有相同的ID记录
If rs.EOF = False Then
MsgBox "已经存在该员工在该月的考勤记录!"
Exit Sub
End If
If Combo1(0).Text = "" Then
MsgBox "部门没有选定!"
Exit Sub
End If
If Combo1(1).Text = "" Then
MsgBox "姓名没有选!"
Exit Sub
End If
If Text1.Text = "" Then
MsgBox "本月天数不能空!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "公休天数不能空!"
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "应出勤天数不能空!"
Exit Sub
End If
'加入新记录
rs.AddNew
rs.Fields(0) = Combo1(0)
rs.Fields(1) = Combo1(1)
rs.Fields(2) = Format(Combo3 & "-" & Combo4 & "-01", "yyyy-mm-dd")
rs.Fields(3) = Text1
rs.Fields(4) = Text2
rs.Fields(5) = Text3
rs.Fields(6) = Text4
rs.Fields(7) = Text5
rs.Fields(8) = Text6
rs.Fields(9) = Text7
rs.Fields(10) = Text8
rs.Fields(11) = Text9
rs.Fields(12) = Text10
rs.Fields(13) = Text11
rs.Fields(14) = Text12
rs.Update
MsgBox "添加成功!"
Combo1(0) = ""
Combo1(1) = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
Text12 = ""
End Sub
Private Sub Command2_Click()
kaoqinxinxi.Hide
jiudianneibuziliaocaidan.Show
End Sub
Private Sub Form_Load()
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(App.Path & "\员工基本信息")
Set rs = db.OpenRecordset("员工基本信息")
Set rs = db.OpenRecordset("select distinct 部门 from 员工基本信息")
If Not rs.EOF Then
Do While Not rs.EOF
Combo1(0).AddItem Trim(rs!部门)
rs.MoveNext
Loop
Combo1(0).ListIndex = 0
Else
MsgBox "请先进行员工档案登记!", vbOKOnly + vbExclamation, "警告"
Command1.Enabled = False
Exit Sub
End If
Dim intcount As Integer
Dim dateTemp As Date
Dim a As String
Combo3.AddItem Year(Now) '加入现在的年代
Combo3.AddItem Year(Now) - 1
Combo3.ListIndex = 0
For intcount = 1 To 12 '加入1-12月
Combo4.AddItem intcount
Next intcount
Combo4 = Month(Now) '得到现在的月份
'初始化本月天数
dateTemp = DateAdd("d", -1, DateAdd("m", 1, DateSerial(CInt(cboYear), CInt(cboMonth), 1)))
Text1 = Day(dateTemp)
rs.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -