CmdNullTime
TSamsi = CombSal & TxtMonthnum & "30"
If Not IsNull(JoinedRemain) Then JoinedRemain = MyDiff(DateJoined, TSamsi)
If JoinedRemain <= 0 Then Exit Sub
AllowedTimeA.Caption = (1350 / 30) * JoinedRemain
If AllowedTimeA.Caption > 1350 Then
MovedfirstA.Caption = Int(AllowedTimeA.Caption) - 1350
AllowedTimeA.Caption = 1350
Else
MovedfirstA.Caption = 0
AllowedTimeA.Caption = (1350 / 30) * JoinedRemain
End If
SamAllowedTimeA.Caption = Val(Nz(MovedfirstA.Caption, "")) + Val(Nz(AllowedTimeA.Caption, ""))
If Not IsNull(DLookup("Expr1", "qryLeave", "PersonelCode=" & Me.PersonelCode & " and int(left(LeaveDateEnd,6))<=" & Int(Left(TSamsi, 6)) & " AND LeaveTypeID>=1 AND LeaveTypeID<=2")) Then
SumLeaveA.Caption = DSum("Expr1", "qryLeave", "PersonelCode=" & Me.PersonelCode & " and int(left(LeaveDateEnd,6))<=" & Int(Left(TSamsi, 6)) & " AND LeaveTypeID>=1 AND LeaveTypeID<=2")
Else
SumLeaveA.Caption = 0
End If
RemainTimeA.Caption = Val(SamAllowedTimeA.Caption) - Val(SumLeaveA.Caption)
RemainTimeA.Caption = (IIf(Split(RemainTimeA.Caption, ":")(0) < 0, "00:00", CalcHrsMins(RemainTimeA.Caption)))
AllowedTimeA.Caption = CalcHrsMins(AllowedTimeA.Caption)
SumLeaveA.Caption = CalcHrsMins(SumLeaveA.Caption)
MovedfirstA.Caption = CalcHrsMins(MovedfirstA.Caption)
SamAllowedTimeA.Caption = CalcHrsMins(SamAllowedTimeA.Caption)