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.
6 27680 ADezii 8,834
Recognized Expert Expert
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).
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
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?
MSeda 159
Recognized Expert New Member
On a form you can you run validations in a controls before update event like - if Len(me.textbox) <> 10 then
-
msgbox "Phone # must have ten digits"
-
cancel=true
-
end if
unfortunately on the table level you get what you get for validations and error messages.
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
@Michael R
This will do that, 2279 being the error code for data not matching the Input Mask: - Private Sub Form_Error(DataErr As Integer, Response As Integer)
-
Dim Message As String
-
If DataErr = 2279 Then 'Data entered doesn't match Input Mask
-
Message = "You Have Entered Invalid Data For The Field: " & Me.ActiveControl.Name
-
Response = MsgBox(Message, vbExclamation, "Invalid Value Entered")
-
Response = acDataErrContinue
-
End If
-
End Sub
Linq ;0)> Sign in to post your reply or Sign up for a free account.
Similar topics |
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 string
match that first number. I'm using this code for form validation of a
telephone number.
Previous records from the past few months show that when someone is
just messing around on one of our forms (to waste our time), they type
|
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 full name is required. Please enter your full name!');
validity = false;
frmComments.name.focus();
|
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 onBlur: "return ph(this);"). Now
the problem is that if the user hits Enter data still goes to the
database (of course, because I should have the function called in the
form's onSubmit......
But how can I do this because I should now have 4...
|
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)
{
DecimalPos=NomeCampo.value.Indexof(',');
Lungh=TotInteri+TotDecimali+1; //sum the ineger + decimal +
decimal separator
|
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 ;-(
I have seen the one from Dreamweaver but I am not using this package.
| |
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 honest I usually hire someone to do it for me, grab predone
scripts and kind of hack out the parts that I need, or just do very
minimal validation (e.g. this is numeric, this is alpha-numeric, etc.)
|
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 formats (555-555-5555 or
(555) 555-5555 or 555 555 5555) but I'm having trouble when the entry is
ten consecutive numbers with nothing else (5555555555). Not only does it
not validate, but it shows as 2147483647 when I call the variable to
check to see...
|
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 in html already and need to figure out how to write this script.
1.
select any number of products (checkboxes) and set quantities for each. Must set at least one product and selected products must have a quantity value > 0.
2. The second...
|
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 after entereing the 11 digit can anyone tell me how can i solve this problem
or can anyone help me to get this format for us phonenumbers.
I want the code like while entering the digits only i should get "-" at the 4th and 8th positions and...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |