Link to home
Start Free TrialLog in
Avatar of Qassim Aubaid
Qassim AubaidFlag for Iraq

asked on

code for phone number

Hi Experts
Please I want a code or a mask to enter phone numbers assigned to one of the two … first for mobile phone numbers, for example, 248-0072-0115 (202) and the second is a pattern for regular telephone numbers (049-39-260) 202)
- For entering phone numbers, regardless of whether the number is for a mobile phone or for a normal phone, I would like to distinguish between the two types by typing zero if it starts with zero taking the mobile pattern and not starting with zero taking the normal pattern
Avatar of John
John
Flag of Canada image

You need to find out from where you are what the long distance codes are.

I enter my contact phone numbers here (North America) as +1(416)5550000 and it dials locally (100% of the time) if I am local to (416).

That is really all there to it (in my location) but you need the long distance codes to put in. It may be different where you are.
Also it is much more a phone company thing than a smart phone issue.  Ordinary phones use local when they can even it +1 was added
Avatar of John Tsioumpris
Probably other solutions will be proposed but I reckon the easiest one would be a toggle button
... default whatever you want...click it turns to the other
Iraq really has a mess when it comes to phone #'s as there isn't much standardization.  The saving grace is that the number of valid numbers is a short list
Landlines
Area/City	Area Code

Baghdad	1	
Salah ad Din (Tikrit)	21
Erbil (Arbil)	66	
Dohuk	62
Wasit (Al Kut)	23	
Anbar (Ramadi)	24
Diyala (Baquba)	25	
Babil (Hilla)	30
Karbala	32	
Najaf	33
Al-Qādisiyyah (Diwaniya)	36	
Al Muthanna (Samawa)	37
Basrah	40	
Dhi Qar (Nasiriya)	42
Maysan (Amarah)	         43	
Kirkuk	50
Sulaimaniya	53	
Ninawa (Mosul)	60

Open in new window


List of Mobile Phones Codes in Iraq
073x xxx xxxx Korek Telecom (formerly SanaTel)
074x xxx xxxx Itisaluna and Kalemat
075x xxx xxxx Korek Telecom
076x xxx xxxx Mobitel (Iraq-Kurdistan) and Moutiny
077x xxx xxxx AsiaCell
078x xxx xxxx Zain Iraq, (formerly MTC Atheer)
079x xxx xxxx Zain Iraq, (formerly Iraqna)
So mobile phones will be 073 to 079  + 11 Digits
Bagdad having an area code of 1 digit being 1 while the other area codes are 2 digits.

Too bad it isn't 3 digit area code + 7 digits like most of the world
in your case, you only need to check for the first character being "(" or not.
Avatar of Qassim Aubaid

ASKER

I found this code
it is working well
Thanks for your attention
[If IsNull(ActiveControl) Or ActiveControl = "" Then Exit Sub
Dim vl As String
vl = ActiveControl.Value
vl = Replace(vl, "(", "")
vl = Replace(vl, ")", "")
vl = Replace(vl, "-", "")
vl = Replace(vl, " ", "")
If Mid(vl, 4, 1) = 0 Then
vl = Format(vl, "(000) 0000-0000-000")
Else
vl = Format(vl, "(000) 000-00-000")
End If
ActiveControl = vl]
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.