I have a problem which i have datatable for getHoliday and a boolean to check an error when user enter wrong input for example user dont select any value from combobox so it'll show you an error after you click the button submit. the datatable getHoliday is use for when user click any date on holiday it'll not execute when user click button submit. So now, i need a solution for when user click button submit it'll show an error message.
Below is the function for checking.
Private Function ErrorFree() As Boolean
If lblEmpNO.Text = "" Then
DisplayMessage("error", "ERROR", "Please Select Employee No!")
Return False
Exit Function
ElseIf lblemployeename.Text = "" Then
DisplayMessage("error", "ERROR", "Please Select Employee No!")
Return False
Exit Function
ElseIf lbldepartment.Text = "" Then
DisplayMessage("error", "ERROR", "Please Select Employee No!")
Return False
Exit Function
ElseIf cmbReason.SelectedIndex = -1 Then
DisplayMessage("error", "ERROR", "Please Select The Reason!")
Return False
Exit Function
ElseIf datepickerFrom.Text = "" Then
DisplayMessage("error", "ERROR", "Please Select The Date!")
Return False
Exit Function
ElseIf datepickerto.Text = "" Then
DisplayMessage("error", "ERROR", "Please Select The Date!")
Return False
Exit Function
ElseIf txtRemark.Text = "" Then
DisplayMessage("error", "ERROR", "Remarks is empty!")
Return False
Exit Function
End If
Return True
End Function