Solved

national and international phone number input mask

Posted on 2006-06-28
6
662 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
Comment Utility
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
Comment Utility
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
Comment Utility
make that, I'm looking for ideas.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:eliwil
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now