【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-frmAbsenceEdit.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Begin VB.Form frmAbsenceEdit
BorderStyle = 4 'Fixed ToolWindow
Caption = "正常出勤编辑"
ClientHeight = 2385
ClientLeft = 45
ClientTop = 285
ClientWidth = 5310
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2385
ScaleWidth = 5310
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000000&
ForeColor = &H80000008&
Height = 2385
Left = 0
ScaleHeight = 2355
ScaleWidth = 5265
TabIndex = 0
Top = 0
Width = 5295
Begin VB.ComboBox comDays
Height = 300
Left = 3390
TabIndex = 12
Top = 690
Width = 1515
End
Begin VB.ComboBox comType
Height = 300
Left = 3390
TabIndex = 10
Top = 180
Width = 1485
End
Begin VB.TextBox txtAbsId
BackColor = &H00E0E0E0&
Enabled = 0 'False
Height = 315
Left = 960
TabIndex = 5
Top = 180
Width = 1455
End
Begin VB.TextBox txtName
BackColor = &H00E0E0E0&
Enabled = 0 'False
Height = 315
Left = 960
TabIndex = 4
Top = 1200
Width = 1455
End
Begin VB.TextBox txtId
BackColor = &H00E0E0E0&
Enabled = 0 'False
Height = 315
Left = 960
TabIndex = 3
Top = 660
Width = 1455
End
Begin VB.CommandButton cmdOK
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 465
Left = 1200
Picture = "frmAbsenceEdit.frx":0000
Style = 1 'Graphical
TabIndex = 2
Top = 1710
Width = 1215
End
Begin
VB.CommandButton cmdCancel
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 465
Left = 2790
Picture = "frmAbsenceEdit.frx":1DCE
Style = 1 'Graphical
TabIndex = 1
Top = 1710
Width = 1215
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "扣除天数"
Height = 180
Left = 2580
TabIndex = 11
Top = 720
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出勤类型"
Height = 180
Index = 4
Left = 2580
TabIndex = 9
Top = 240
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出勤编号"
Height = 180
Index = 3
Left = 120
TabIndex = 8
Top = 270
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "员工"
Height = 180
Index = 1
Left = 120
TabIndex = 7
Top = 1230
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "员工编号"
Height = 180
Index = 0
Left = 120
TabIndex = 6
Top = 720
Width = 720
End
End
End
Attribute VB_Name = "frmAbsenceEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If txtAbsId.Text = "" Then
MsgBox "请选择员工信息!", vbOKOnly, "注意"
Exit Sub
End If
If comType.Text = "" Then
MsgBox "请选择考勤类别!", vbOKOnly, "注意"
comType.SetFocus
Exit Sub
End If
If comDays.Text = "" Then
MsgBox "请选择扣除天数!", vbOKOnly, "注意"
comDays.SetFocus
Exit Sub
End If
On Error GoTo err
With frmAbsence.rsAbsence_Adodc.Recordset
.AddNew
.Fields(0) = Trim(txtAbsId.Text)
.Fields(1) = Trim(txtId.Text)
.Fields(2) = Trim(comType.Text)
If comDays.Text = "半天" Then
.Fields(3) = 0.5
Else
.Fields(3) = 1
End If
.Update
End With
MsgBox "成功添加考勤数据!", vbOKOnly + vbInformation, "完成"
Exit Sub
err:
MsgBox err.Description, vbOKOnly + vbCritical, "错误"
End Sub
Private Sub Form_Load()
comType.AddItem "迟到"
comType.AddItem "早退"
comDays.AddItem "半天"
comDays.AddItem "一天"
End Sub