I am VERY new to VB.Net programming and am having a problem with an Overload exception due to the way I built my strings/substrings. Here's the first part of my code causing the problem:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PhoneNum = TextBox1.Text
Num1 = PhoneNum.Substring(0, 3)
Num2 = PhoneNum.Substring(4, 3)
Num3 = PhoneNum.Substring(8)
If Not IsNumeric(Num1) Then
MessageBox.Show( _
"The phone number you entered " & TextBox1.Text & " is not valid." _
& " ERROR: It must conatin only numbers.", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error, _
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
ElseIf Not IsNumeric(Num2) Then
MessageBox.Show( _
"The phone number you entered " & TextBox1.Text & " is not valid." _
& " ERROR: It must conatin only numbers.", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error, _
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
ElseIf Not IsNumeric(Num3) Then.....

If I do not enter enough characters to satisfy the substrings, I get the Overlaod exception. PLEASE ADVISE and Thanks in advace.

Christos