title: Validating multiple textboxes with multiple checks
body: <p>I have multiple textboxes in a groupbox, and can successfully cycle through them all. However the checkNumbers sub fails to recognise blank/null entries, and also non-numeric characters. The correctValidation boolean should return true if all the criteria are met (no blanks/nulls, and must be a number between 1-20). Any thoughts on how to solve this would be appreciated.</p>
  
  <pre><code>Private Sub checkNumbers()
  
  Try
              For Each txt As TextBox In Me.gbTechnical.Controls.OfType(Of TextBox)()
                  If txt.Text &lt;&gt; "" And IsNumeric(txt.Text) And (Integer.Parse(txt.Text) &gt;= 1 And Integer.Parse(txt.Text) &lt;= 20) Then
                      correctValidation = True
                  Else
                      correctValidation = False
                      MsgBox("Please ensure all numbers are between 1 and 20")
                      Exit Sub
                  End If
              Next
  
  Catch ex As Exception
              MessageBox.Show("General: Please ensure all numbers are between 1 and 20")
          End Try
  
      End Sub
  </code></pre>