Public Class frmReportOvertime
    Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
        If rbDate.Checked = True Then
            PrintEmployeeOvertime(" SELECT        Overtime.EMPLOYEE_ID, Employee_Information.EMP_CODE, Employee_Information.EmployeesName, Employee_Information.MobileNumber, Overtime.EnrollDate, Overtime.StartTime, Overtime.EndTime,  " &
                                  " Overtime.Overtime_Mins, Overtime.OvertimeRate FROM            Overtime LEFT OUTER JOIN Employee_Information ON Overtime.EMPLOYEE_ID = Employee_Information.EMPLOYEE_ID " &
                                  " WHERE        (Overtime.EnrollDate >= '" & Format(dtpFrom.Value, "yyyy-MM-dd") & "' AND Overtime.EnrollDate <= '" & Format(dtpTo.Value, "yyyy-MM-dd") & "') ", "From " + Format(dtpFrom.Value, "yyyy-MM-dd") + ", To " + Format(dtpTo.Value, "yyyy-MM-dd"))
        ElseIf rbEmployees.Checked = True Then
            If cmbEmployee.SelectedValue Is Nothing Or cmbEmployee.SelectedIndex = -1 Then
                ErrorProvider1.SetError(cmbEmployee, "Mandatory field.")
            Else
                ErrorProvider1.Clear()
                PrintEmployeeOvertime(" SELECT        Overtime.EMPLOYEE_ID, Employee_Information.EMP_CODE, Employee_Information.EmployeesName, Employee_Information.MobileNumber, Overtime.EnrollDate, Overtime.StartTime, Overtime.EndTime, " &
                                      " Overtime.Overtime_Mins, Overtime.OvertimeRate FROM            Overtime LEFT OUTER JOIN Employee_Information ON Overtime.EMPLOYEE_ID = Employee_Information.EMPLOYEE_ID " &
                                      " WHERE        (Overtime.EMPLOYEE_ID = " & num_fltr(cmbEmployee.SelectedValue) & ") ", "EMP. NAME - " + cmbEmployee.Text)
            End If
        End If
    End Sub

    Private Sub frmReportOvertime_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        FillDataComboBox("SELECT  EMPLOYEE_ID, EmployeesName FROM Employee_Information", "EMPLOYEE_ID", "EmployeesName", cmbEmployee)
    End Sub
End Class