LouLou
January 28th, 2000, 02:29 PM
I have this code for checking to see if a phone
number is entered as numbers but it is not working
could someone tell me why?
If isempty(Phone) then
PhoneIsOkay = false
PageIsOkay = false
else
If len(Phone)<>8then
PhoneIsOkay = false
PageIsOkay = false
i = 1
While i < 8 'there are eight spaces that you want to check
Select Case i
Case 1,2,3 ' the positions in the string that should be numbers
If Not IsNumeric(mid(Phone,i,1)) then 'Check the format
PageIsOkay = false
End If
Case 4 'check that middle for a dash
If IsNumberic(mid(Phone, i, 1)) then
PageIsOkay =false
End If
Case 5,6,7 ' the positions in the string that should be numbers
If Not IsNumeric(mid(Phone,i,1)) then 'Check the format
PageIsOkay = false
End If
End Select
i= i+1
Wend
End If
End If
Thanks
Louise
number is entered as numbers but it is not working
could someone tell me why?
If isempty(Phone) then
PhoneIsOkay = false
PageIsOkay = false
else
If len(Phone)<>8then
PhoneIsOkay = false
PageIsOkay = false
i = 1
While i < 8 'there are eight spaces that you want to check
Select Case i
Case 1,2,3 ' the positions in the string that should be numbers
If Not IsNumeric(mid(Phone,i,1)) then 'Check the format
PageIsOkay = false
End If
Case 4 'check that middle for a dash
If IsNumberic(mid(Phone, i, 1)) then
PageIsOkay =false
End If
Case 5,6,7 ' the positions in the string that should be numbers
If Not IsNumeric(mid(Phone,i,1)) then 'Check the format
PageIsOkay = false
End If
End Select
i= i+1
Wend
End If
End If
Thanks
Louise