Solved

national and international phone number input mask

Posted on 2006-06-28
6
671 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

777 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