If InFlag = False And OutFlag = False Then
MsgBox "请选择上下班", vbOKOnly + vbExclamation, "警告!"
End If
'添加上班信息
If InFlag = True Then
If txtID.Text = "" Or txtName.Text = "" Then
MsgBox "要添加上班信息,员工编号与姓名不能为空,请输入", vbOKOnly, "提示"
Exit Sub
End If
'判断上下午上班时间是否迟到
tmsb1 = dtpBT.Value
h = Hour(tmsb1)
m = Minute(tmsb1)
s = Second(tmsb1)
tmsb1 = CDate(h & ":" & m & ":" & s)
tmsetswsb = CDate(rsTime.Fields("上午上班时间"))
tmsetswxb = CDate(rsTime.Fields("上午下班时间"))
tmsetxwsb = CDate(rsTime.Fields("下午上班时间"))
'判断上午上班时间是否迟到
If tmsb1 < tmsetswxb Then
If tmsb1 > tmsetswsb Then
ilate = 1
MsgBox "迟到"
Else
ilate = 0
MsgBox "正常上班"
End If
'判断下午上班时间是否迟到
Else
If tmsb1 > tmsetxwsb Then
ilate = 1
MsgBox "迟到"
Else
ilate = 0
MsgBox "正常上班"
End If
End If
aflag = "入"
rs.AddNew
rs.Fields("工号") = txtID.Text
rs.Fields("姓名") = txtName.Text
rs.Fields("当前日期") = dtpET.Value
rs.Fields("上班时间") = dtpBT.Hour & ":" & dtpBT.Minute & ":" & dtpBT.Second
rs.Fields("出入标志") = aflag
rs.Fields("迟到次数") = ilate
rs.Update
rs.Close
MsgBox "已完成添加上班信息", vbOKOnly + vbInformation, "添加结果!"
Unload Me
Exit Sub
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页