Click here to Skip to main content
15,910,981 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Help with code for telephone validator Pin
12String27-Oct-05 11:39
12String27-Oct-05 11:39 
AnswerRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 15:05
protectorChristian Graus27-Oct-05 15:05 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:20
12String27-Oct-05 16:20 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 16:27
protectorChristian Graus27-Oct-05 16:27 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:35
12String27-Oct-05 16:35 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 16:38
protectorChristian Graus27-Oct-05 16:38 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:40
12String27-Oct-05 16:40 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 16:44
protectorChristian Graus27-Oct-05 16:44 
12String wrote:
I still need to code in VB.NET so therein lays my problem


Yeah, VB sucks, but it can sure do this as easily as any other language ( and easier than vanilla C++ )

12String wrote:
If (Not IsNumeric(Me.TextBox1.Text)) Then 'checks user input for numeric and range


This plainly does not work. You should try to follow my advice, and either use a regex, or, if you must, split the string and validate it from there.

12String wrote:
If TextBox1 = ("999" & "-" & "999" & "-" & "9999") Then
MsgBox("You have entered a correct phone number.")
ElseIf TextBox1 = "999999" & "-" & 9999 Then
MsgBox("You need to enter a " - " between the area code and prefix number.")
ElseIf TextBox1 = "999" & "-" & "9999999" Then
MsgBox("You need to enter a " - " between the prefix and phonenumber.")
End If


This requires the numbers to be all nines. Your check input function should check all cases, you shouldn't be adding validation afterwards. The regex can be used to do this as well, although the split solution would make it easier to do this and give a detailed error.


Christian Graus - Microsoft MVP - C++
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:48
12String27-Oct-05 16:48 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:11
protectorChristian Graus27-Oct-05 17:11 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:14
12String27-Oct-05 17:14 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:23
protectorChristian Graus27-Oct-05 17:23 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:26
12String27-Oct-05 17:26 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:27
protectorChristian Graus27-Oct-05 17:27 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:31
12String27-Oct-05 17:31 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:34
protectorChristian Graus27-Oct-05 17:34 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:41
12String27-Oct-05 17:41 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:48
protectorChristian Graus27-Oct-05 17:48 
GeneralRe: Help with code for telephone validator Pin
Steve Pullan27-Oct-05 18:38
Steve Pullan27-Oct-05 18:38 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 18:41
protectorChristian Graus27-Oct-05 18:41 
GeneralRe: Help with code for telephone validator Pin
Dave Kreskowiak28-Oct-05 4:58
mveDave Kreskowiak28-Oct-05 4:58 
GeneralRe: Help with code for telephone validator Pin
Christian Graus30-Oct-05 11:13
protectorChristian Graus30-Oct-05 11:13 
QuestionRe: Help with code for telephone validator Pin
seee sharp27-Oct-05 19:12
seee sharp27-Oct-05 19:12 
AnswerRe: Help with code for telephone validator Pin
12String27-Oct-05 19:13
12String27-Oct-05 19:13 
QuestionDetecting system events Pin
Brett Peirce27-Oct-05 9:21
Brett Peirce27-Oct-05 9:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.