📄 add_kq.frm
字号:
Width = 495
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "年 "
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1920
TabIndex = 17
Top = 240
Width = 495
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "应出勤天数"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
TabIndex = 14
Top = 840
Width = 1335
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "本月天数"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
TabIndex = 13
Top = 240
Width = 1095
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "公休天数"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 12
Top = 840
Width = 1335
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "考勤年月"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 11
Top = 240
Width = 1335
End
End
End
Begin VB.Frame Frame2
BackColor = &H00D8D7D5&
Caption = "员工基本信息"
Height = 855
Left = 120
TabIndex = 2
Top = 120
Width = 7575
Begin VB.ComboBox cmbdepart
Height = 300
Left = 3120
TabIndex = 47
Top = 360
Width = 1455
End
Begin VB.TextBox txtname
Height = 375
Left = 5640
TabIndex = 7
Top = 360
Width = 1695
End
Begin VB.TextBox txtID
Height = 375
Left = 1080
TabIndex = 6
Top = 360
Width = 1335
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 375
Left = 4800
TabIndex = 5
Top = 360
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "编号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 4
Top = 360
Width = 615
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "部门"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2520
TabIndex = 3
Top = 360
Width = 615
End
End
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "添 加 员 工 考 勤 信 息"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Left = 2040
TabIndex = 1
Top = 240
Width = 2775
End
Begin VB.Image Image1
Height = 345
Left = 7560
Picture = "add_kq.frx":6783
Top = 0
Width = 345
End
End
Attribute VB_Name = "add_kq"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Set rs3 = New ADODB.Recordset
Dim kqny As String
kqny = txtyear.Text + txtmonth.Text
'txtyear.Text)Trim(txtmonth.Text)
SqlStmt = "insert into ygkqzb values( '" + Trim(txtID.Text) + "','" + Trim(txtName.Text) + "','" + Trim(cmbdepart.Text) + "','" + Trim(kqny) + "','" + Trim(txtday1.Text) + "','" _
+ Trim(txtday2.Text) + "','" + Trim(txtday3.Text) + "','" + Trim(txtmoney1.Text) + "','" + Trim(txtmoney2.Text) + "','" + Trim(txtcq.Text) + "','" + Trim(txtkg.Text) + "','" _
+ Trim(txtnx.Text) + "','" + Trim(txtqj.Text) + "','" + Trim(txtcd.Text) + "', '" + Trim(txtzt.Text) + "','" + Trim(txtqt.Text) + "','" + Trim(txtjb.Text) + "','" + Trim(txtcc.Text) + "','" + Trim(txtbz.Text) + "')"
mydb.opendb
b = mydb.exesql(SqlStmt, rs3, True)
mydb.closedb
If b Then
MsgBox "添加成功", 48, "提示"
Else
MsgBox "操作失败", 48, "提示"
End If
Call clear
End Sub
Public Sub clear()
txtID.Text = ""
txtName.Text = ""
cmbdepart.Text = ""
txtyear.Text = ""
txtmonth.Text = ""
txtday1.Text = ""
txtday2.Text = ""
txtday3.Text = ""
txtmoney1.Text = ""
txtmoney2.Text = ""
txtkg.Text = ""
txtzt.Text = ""
txtnx.Text = ""
txtqj.Text = ""
txtcd.Text = ""
txtjb.Text = ""
txtqt.Text = ""
txtcc.Text = ""
txtbz.Text = ""
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set rs3 = New ADODB.Recordset
With txtmonth
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
.AddItem "8"
.AddItem "9"
.AddItem "10"
.AddItem "11"
.AddItem "12"
End With
With txtyear
.AddItem "2006"
.AddItem "2007"
.AddItem "2008"
.AddItem "2009"
.AddItem "2010"
.AddItem "2011"
.AddItem "2012"
End With
SqlStmt = "select *from Department"
mydb.opendb
b = mydb.exesql(SqlStmt, rs3, True)
With cmbdepart
While Not rs3.EOF
.AddItem rs3.Fields(1)
rs3.MoveNext
Wend
End With
mydb.closedb
End Sub
Private Sub Image1_Click()
Unload Me
End Sub
Private Sub txtmonth_Click()
Dim month As String
Dim year As Integer
month = txtmonth.Text
Select Case month
Case "1"
txtday1.Text = "31"
Case "3"
txtday1.Text = "31"
Case "5"
txtday1.Text = "31"
Case "7"
txtday1.Text = "31"
Case "8"
txtday1.Text = "31"
Case "10"
txtday1.Text = "31"
Case "12"
txtday1.Text = "31"
Case "4"
txtday1.Text = "30"
Case "6"
txtday1.Text = "30"
Case "9"
txtday1.Text = "30"
Case "2"
year = Val(txtyear.Text)
If (year Mod 4 = 0 And year Mod 100! = 0) Or (year Mod 400 = 0) Then
txtday1.Text = "29"
Else
txtday1.Text = "28"
End If
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -