Solved

national and international phone number input mask

Posted on 2006-06-28
6
674 Views
Last Modified: 2009-12-16
I've got a situation where I need to be able to switch back and forth on a form control between a national and an international input mask for phone numbers. I'm not sure how to approach it. I remember reading an article about doing just this but can't for the life of me remember the source or the approach.
0
Comment
Question by:eliwil
  • 3
  • 2
6 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17004985
Is it something like this

!\(999") "000\-0000;0;_


If u want international, u put in the prefix for that in front of it
0
 

Author Comment

by:eliwil
ID: 17007281
how would you go about changing the input mask? what would you use as a trigger? how would you present the choice to the user? looking for ideas?

E
0
 

Author Comment

by:eliwil
ID: 17007285
make that, I'm looking for ideas.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:eliwil
ID: 17007392
Just did a search and came up with the following:

Title: Turn off input mask via coding

I think this will do the trick for me.

E
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 17007875
How to do in code,

I think u found something,

But here is one way to set the input mask

Using the mask Ive supplied, since it contains double quotes we have to include them another way

e.g.

    txtPhoneNo.InputMask = "!\(999" & Chr$(34) & ") " & Chr$(34) & "000\-0000;0;_"


0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 17056555
eliwil,

Got this from somewhere... don't remember... hope it helps!
:)

If/Then/Else/End If, InputMask, Or, Value
You need a variable Input Mask for telephone numbers. If the client is from Canada or USA, the Input Mask would force "(514) 257-0734" but if the client is from Europe, you don't want any input mask". In the Event "Get Focus" of the telephone number text box, You will write this code:
    If countryField.Value = "Canada" or countryField.Value = "USA" Then
        telephoneNumberField.InputMask = "!\(999) 000-0000;0;_"
    Else
        telephoneNumberField.InputMask = ""
    End If


Bsically you change the mask based on the country.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question