473,810 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

only Zeros in telephone number field check

553 Contributor
Hi

I have a text field for telephone number.

It is set to take atleast 10 digit and maximum 15 digits

How can i write a condition that would alert us if the 11th to 15th digits are only 0 (zeros) or only 1(ones) , 2, 3, so on ??

Thanks
Jul 9 '07 #1
2 1456
questionit
553 Contributor
Hi

I have a text field for telephone number.

It is set to take atleast 10 digit and maximum 15 digits

How can i write a condition that would alert us if the 11th to 15th digits are only 0 (zeros) or only 1(ones) , 2, 3, so on ??

Thanks
Just to add that user can input 11, 12 , 13, 14 or 15 digits.
so if any number of digits after the 10th digit is '0'.. an alert should show
Jul 9 '07 #2
Killer42
8,435 Recognized Expert Expert
I have a text field for telephone number.
It is set to take atleast 10 digit and maximum 15 digits
How can i write a condition that would alert us if the 11th to 15th digits are only 0 (zeros) or only 1(ones) , 2, 3, so on ??
Not sure I entirely understand what you're trying to achieve. But you might try a simple brute-force approach, something like this...
Expand|Select|Wrap|Line Numbers
  1. LastPart = Left$(strPhonenum,11)
  2. Select Case LastPart
  3.   ' Just list here all the combinations you want to disallow. Such as...
  4.   Case "11111", "22222", "33333", "44444", _
  5.        "55555", "66666", "77777", "88888", "99999", "00000"
  6.     ' Do a dummy-spit.
  7. End Select
Jul 10 '07 #3

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

Similar topics

5
11515
by: samik_tanik | last post by:
I need to export a datagrid to Excel. I could did this. But, also need to keep the leading zeros in the data. How can I acheive this? Any help would be appreciated. -- Thanking you in anticipation, Regards,
1
4558
by: mmmgood1 | last post by:
Help, I'm linking an excel spreadsheet in access and I have datafields with leading zeros (01021). When the file is linked in access, I get a #num in the field with the leading zeros. The zeros are needed. I've formated the field to be a text field, general number, and number and still I get the #num! error, or the leading zero is dropped. Can someone help before I pull more of my hair. Thanks a bunch.
5
1576
by: John Baker | last post by:
Hi:: I have 2 fields, an alphabetic and a number. I wish to combine them so that they form a field which has 5 positions in it. Number can be from 1 to 9999 Letter from A to Z I planned to concatenate them thus:Letter&Number to form a field that looks like the following:
5
25592
by: tpcolson | last post by:
I have a fairly large access 2003 table (200,000) records. Field 'X' is a text field, and contains either no value, 4 digits, 5 digits, or 6 digits. What I need to do is to add two zeros to the left of the records with 4 digits in field 'X', 1 zero to the left of the records with 5 digits in field 'X', and 6 digits for nulls. IE, record 1 field 'X' contains 1234, after this magic, it would contain 001234. Bear in mind, I have ABSOLUTLY...
2
1601
by: Teep | last post by:
I have a simple text box called txtrefnum, if the user enters a number length less than 9 characters long than I need to have lead zeros added to it. Does anyone know how to do this? I couldn't find anything online on the subject... <asp:TextBox id="txtRefNum" runat="server"></asp:TextBox> I thought I could use a validator for the process and make the user add the zeros, but of course that is a big no-no! Please help!!
6
1417
by: TN Bella | last post by:
I have a simple text box called txtrefnum, if the user enters a number length less than 9 characters long than I need to have lead zeros added to it. Does anyone know how to do this? I couldn't find anything online on the subject... <asp:TextBox id="txtRefNum" runat="server"></asp:TextBox> I thought I could use a validator for the process and make the user add the zeros, but of course that is a big no-no! Please help!!
6
13347
by: Brian Campbell | last post by:
HELP! SOS! I have a field that I'm trying to format within a query. The results from my field "Appointment.EMP_FILE_NB" give various numbers: (e.g.: 213 105523 125400 1245 834
3
3309
by: brad.goldberg | last post by:
Hey All, I know this has been addressed in a few different conversations but none are exactly what I am trying to do, bear with me I am an access Newbie. Basically I have a form that assigns Run Numbers to each record (EMS agency, each record is a Run Number, versus like a PO number or Work Order..).
4
21044
by: sreemati | last post by:
Hi, I have seen various online resources and tuturials. I ahve written a piece of code but it does not seem to work Problem defined: If not number entered (as not mandartory) ignore else if yes then remove the spaces
0
9722
marktang
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...
0
9603
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,...
0
10644
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, 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...
0
10124
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 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...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.