Public Class frmReportAllowances
    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
            PrintEmployeeAllowances(" SELECT        Allowance.EMPLOYEE_ID, Employee_Information.EMP_CODE, Employee_Information.EmployeesName, Employee_Information.MobileNumber, Allowance.EnrollDate, Allowance.AllowanceName,  Allowance.AllowanceAmount " &
                        " FROM            Allowance LEFT OUTER JOIN Employee_Information ON Allowance.EMPLOYEE_ID = Employee_Information.EMPLOYEE_ID WHERE        (Allowance.EnrollDate >= '" & Format(dtpFrom.Value, "yyyy-MM-dd") & "' AND Allowance.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()
                PrintEmployeeAllowances(" SELECT        Allowance.EMPLOYEE_ID, Employee_Information.EMP_CODE, Employee_Information.EmployeesName, Employee_Information.MobileNumber, Allowance.EnrollDate, Allowance.AllowanceName,  Allowance.AllowanceAmount " &
                        " FROM            Allowance LEFT OUTER JOIN Employee_Information ON Allowance.EMPLOYEE_ID = Employee_Information.EMPLOYEE_ID WHERE        (Allowance.EMPLOYEE_ID = " & num_fltr(cmbEmployee.SelectedValue) & ")", "EMP. NAME - " + cmbEmployee.Text)
            End If
        End If
    End Sub

    Private Sub frmReportAllowances_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