473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

What is the Validation Rule for a certain number of digits phone number?

176 100+
I haven't found anything that would help me to understand the correct syntax for having a certain number of digits phone number validation rule.

My input mask for this field is: \000\-0000000;;
When I set the following validation rule: 9999999999 or =9999999999 it doesn't work correctly and it allows short numbers.

How should I compose it correctly.

Thanks, Michael.
Feb 7 '07 #1
6 27578
ADezii
8,834 Expert 8TB
I haven't found anything that would help me to understand the correct syntax for having a certain number of digits phone number validation rule.

My input mask for this field is: \000\-0000000;;
When I set the following validation rule: 9999999999 or =9999999999 it doesn't work correctly and it allows short numbers.

How should I compose it correctly.

Thanks, Michael.
0 - Digit (0 to 9, entry required, plus [+] and minus [–] signs not allowed).
9 - Digit or space (entry not required, plus and minus signs not allowed).
Feb 7 '07 #2
willakawill
1,646 1GB
Your input mask will give you a 3 digit area code always starting with 0 followed by 6 digits. The only thing your validation rule can check for is if the field has been filled in by the user or left blank and only if the field has changed. The mask will take care of validating input
Feb 7 '07 #3
Michael R
176 100+
Your input mask will give you a 3 digit area code always starting with 0 followed by 6 digits. The only thing your validation rule can check for is if the field has been filled in by the user or left blank and only if the field has changed. The mask will take care of validating input
You are right,
Thanks.

Is there a way to customize the error message the intput masks returns?
Feb 7 '07 #4
MSeda
159 Expert 100+
On a form you can you run validations in a controls before update event like
Expand|Select|Wrap|Line Numbers
  1.  if Len(me.textbox) <> 10 then
  2. msgbox "Phone # must have ten digits"
  3. cancel=true
  4. end if  
unfortunately on the table level you get what you get for validations and error messages.
Feb 8 '07 #5
shiznaw
29
Thank you very much for solving a problem that comes up when beginners like me begin to program. I appreciate your knowledge.

Thank you again for chosing to share. Your answer worked when placed in a form.

Shiznaw 11-24-09
Nov 24 '09 #6
missinglinq
3,532 Expert 2GB
@Michael R
This will do that, 2279 being the error code for data not matching the Input Mask:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2. Dim Message As String
  3.  If DataErr = 2279 Then 'Data entered doesn't match Input Mask
  4.   Message = "You Have Entered Invalid Data For The Field: " & Me.ActiveControl.Name
  5.   Response = MsgBox(Message, vbExclamation, "Invalid Value Entered")
  6.   Response = acDataErrContinue
  7.  End If
  8. End Sub
Linq ;0)>
Nov 24 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Eric Linders | last post by:
Hi, I'm trying to figure out the most efficient method for taking the first character in a string (which will be a number), and use it as a variable to check to see if the other numbers in the...
21
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your...
6
by: simina | last post by:
Hi... I have a form with 4 number fields: phone area, phone number, cell area, cell number. I did a function that checks the "number" issue for all 4 fields in the same time (because the code is...
8
by: SAN CAZIANO | last post by:
i have to do in the onkeypress or in onchange the float (real) field validation I try something: function ValidaCampo(nomeCampo,TotInteri,TotDecimali) {...
14
by: milkyway | last post by:
Hello, Is there a good validation package out there that can be used with javascript? I have tried the one here: http://www.peterbailey.net/fValidate/ but had some problems implementing it...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
10
by: JackM | last post by:
I'm still working on validating the phone numbers that are entered on a form but have come across a problem I don't understand how to fix. I can handle most instances when it's in regular US...
9
by: jasonchan | last post by:
im fairly new at javascript but i need to write a script for a project and don't know where to begin. basically it involves form validation... i guess here's the breakdown. I have created a form...
2
by: komaladevi | last post by:
hello all ! Can any one help me in validating US Phone Number , I wrotethe javascript for this to get the phone number as 123-234-1234 but i dont know the reason why i am getting this format only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.