Phone number input mask with default area code

I can't seem to get the right combination with an input mask that has a 
default area code but lets the user change it if necessary. 

Any help would be appreciated. 
Please pardon if this is a duplicate post. I posted yesterday but can't find 
it! 

Thanks!
Marty
0
Utf
4/14/2010 3:11:01 AM
access 16762 articles. 3 followers. Follow

2 Replies
2111 Views

Similar Articles

[PageSpeed] 47

On Tue, 13 Apr 2010 20:11:01 -0700, MartyO <MartyO@discussions.microsoft.com>
wrote:

>I can't seem to get the right combination with an input mask that has a 
>default area code but lets the user change it if necessary. 

That's because it cannot be done with an input mask. Input masks are of very
limited functionality; this isn't one of the things they can do.


>Any help would be appreciated. 
>Please pardon if this is a duplicate post. I posted yesterday but can't find 
>it! 

Here are the two answers that your post received. Note that Microsoft's
webpage Notify function is apparently totally useless, and the Search isn't
much better - http://groups.google.com is (ironically) a lot better at
displaying Microsoft's newsgroups. Here are Arvin and Tony's answers from
yesterday:


<Arvin Meyers, MVP>

Instead of an input mask, use the AfterUpdate event to fix the number. Have 
the users just enter the digits without any formatting. This function can be 
called in the AfterUpdate event:

Public Function FormatPhone(strIn As String) As Variant
On Error Resume Next

If InStr(1, strIn, "@") >= 1 Then
    FormatPhone = strIn
    Exit Function
End If

Select Case Len(strIn & vbNullString)
    Case 0
        FormatPhone = Null
    Case 7
        FormatPhone = Format(strIn, "@@@-@@@@")
    Case 10
        FormatPhone = Format(strIn, "(@@@) @@@-@@@@")
    Case 11
        FormatPhone = Format(strIn, "@ (@@@) @@@-@@@@")
    Case Else
        FormatPhone = strIn
End Select

End Function

Set the default value to you local area code and have the cursor start at 
the end of the value in the text box (set that in options)
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"MartyO" <MartyO@discussions.microsoft.com> wrote in message 
news:7B064069-9309-4FCA-92B1-8CA18643234F@microsoft.com...
>I can not get the right combination to do the following, (maybe it's not
> possible). I want to have an input mask for the entire phone number, but I
> want the area code to default to our local area code, and if it's 
> different
> than that, the user can change it and then type in the rest of the phone
> number.
> Is that possible?
>
> Thanks!
> Marty 


MartyO <MartyO@discussions.microsoft.com> wrote:

>I can not get the right combination to do the following, (maybe it's not 
>possible). I want to have an input mask for the entire phone number, but I 
>want the area code to default to our local area code, and if it's different 
>than that, the user can change it and then type in the rest of the phone 
>number. 


<Tony Toews, MVP>

You will never, ever have an international phone number that is
outside the USA or Canada?

Also what about phone extensions?

I just give the users a text field.

Tony
-- 
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files 
  updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
-- 

             John W. Vinson [MVP]
0
John
4/14/2010 5:09:50 AM
Thanks John! For finding my answers. And for the google tip.

Marty

"John W. Vinson" wrote:

> On Tue, 13 Apr 2010 20:11:01 -0700, MartyO <MartyO@discussions.microsoft.com>
> wrote:
> 
> >I can't seem to get the right combination with an input mask that has a 
> >default area code but lets the user change it if necessary. 
> 
> That's because it cannot be done with an input mask. Input masks are of very
> limited functionality; this isn't one of the things they can do.
> 
> 
> >Any help would be appreciated. 
> >Please pardon if this is a duplicate post. I posted yesterday but can't find 
> >it! 
> 
> Here are the two answers that your post received. Note that Microsoft's
> webpage Notify function is apparently totally useless, and the Search isn't
> much better - http://groups.google.com is (ironically) a lot better at
> displaying Microsoft's newsgroups. Here are Arvin and Tony's answers from
> yesterday:
> 
> 
> <Arvin Meyers, MVP>
> 
> Instead of an input mask, use the AfterUpdate event to fix the number. Have 
> the users just enter the digits without any formatting. This function can be 
> called in the AfterUpdate event:
> 
> Public Function FormatPhone(strIn As String) As Variant
> On Error Resume Next
> 
> If InStr(1, strIn, "@") >= 1 Then
>     FormatPhone = strIn
>     Exit Function
> End If
> 
> Select Case Len(strIn & vbNullString)
>     Case 0
>         FormatPhone = Null
>     Case 7
>         FormatPhone = Format(strIn, "@@@-@@@@")
>     Case 10
>         FormatPhone = Format(strIn, "(@@@) @@@-@@@@")
>     Case 11
>         FormatPhone = Format(strIn, "@ (@@@) @@@-@@@@")
>     Case Else
>         FormatPhone = strIn
> End Select
> 
> End Function
> 
> Set the default value to you local area code and have the cursor start at 
> the end of the value in the text box (set that in options)
> -- 
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.accessmvp.com
> http://www.mvps.org/access
> 
> 
> "MartyO" <MartyO@discussions.microsoft.com> wrote in message 
> news:7B064069-9309-4FCA-92B1-8CA18643234F@microsoft.com...
> >I can not get the right combination to do the following, (maybe it's not
> > possible). I want to have an input mask for the entire phone number, but I
> > want the area code to default to our local area code, and if it's 
> > different
> > than that, the user can change it and then type in the rest of the phone
> > number.
> > Is that possible?
> >
> > Thanks!
> > Marty 
> 
> 
> MartyO <MartyO@discussions.microsoft.com> wrote:
> 
> >I can not get the right combination to do the following, (maybe it's not 
> >possible). I want to have an input mask for the entire phone number, but I 
> >want the area code to default to our local area code, and if it's different 
> >than that, the user can change it and then type in the rest of the phone 
> >number. 
> 
> 
> <Tony Toews, MVP>
> 
> You will never, ever have an international phone number that is
> outside the USA or Canada?
> 
> Also what about phone extensions?
> 
> I just give the users a text field.
> 
> Tony
> -- 
> Tony Toews, Microsoft Access MVP
> Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
> For a convenient utility to keep your users FEs and other files 
>   updated see http://www.autofeupdater.com/
> Granite Fleet Manager http://www.granitefleet.com/
> -- 
> 
>              John W. Vinson [MVP]
> .
> 
0
Utf
4/15/2010 12:51:01 AM
Reply:

Similar Artilces:

Auto calc YTD Numbers
Cells A1:L1 equal "Jan" thru "Dec". M1 equals "YTD". Cells A2:L2 equal numeric values. If you haven't guessed it already, I would like M2 to sum all the values A2:L2 for those months previous and including the current month (but not future months). What is the best way for going about this Here are 2 ways =SUM(OFFSET($A$2,,,,MATCH(TEXT(TODAY(),"mmm"),$A$1:$L$1,0))) or =SUM(OFFSET($A$2,,,,MONTH(TODAY()))) hopefully your computer's clock is accurate -- For everyone's benefit keep the discussion in the newsgroup. Regards, Peo Sjo...

Incorrect number of unread messages in Outlook Express
I've seen this problem listed in several places, but have yet to find a satisfactory answer. Here's my sitation: I have a computer that shows an incorrect number of unread messages in the Outlook Express Inbox whenever it downloads messages. Sometimes it's only 1 more than the number it downloaded, sometimes more. I'm not subscribed to any newsgroups, nor do I have any rules or mail filters enabled, including junk mail filters. We've had this problem through two different IMAP accounts, two different ISPs, two different email addresses, and on two different Windows use...

Project Number Changer
Some of our clients would love to see an addition to the Professional Services Tools Library to modify project numbers in project accounting. One of our clients uses this to track organizational projects and whenever there is a department re-org, they would like to merely renumber or rename the existing projects to accomodate. Jen, I wholeheartedly agree!! Our company has 1,500+ ongoing projects for journals where the names of the journals can change over time. We would like to be able to change the Project ID and Contract ID so the acronyms used in the ID's are intuitively rala...

Change Default Add-in Folder
Great Day! Is there a way to change default add-in folder in Excel so in stead o going to the C:\Documents and Settings\"username"\Applicatio Data\Microsoft\Addins\ it goes to my folder (C:/MyAddins). Thank you. Compound -- compoun ----------------------------------------------------------------------- compound's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1155 View this thread: http://www.excelforum.com/showthread.php?threadid=38688 I think if you use Regedit to modify this key value: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\Gene...

Multiple Numbers on ONE Label
I have several thousand labels I need to print. I would like to put up to 4 part numbers on each label (Avery 5164). These labels will placed on boxes that hold product. Some labels may only get 2 or 3 part numbers per label depending on size of the part. My part numbers are classified as S,M,L. Can this be done? Example... ABC123 - small ABC234 - large (max 2 numbers per label) ABC345 - small ABC456 - med (max 3 numbers per label) BCD123 - small BCD234 See: Print a Quantity of a Label at: http://allenbrowne.com/ser-39.html The article assumes you have a Q...

Copying autonumbered paragraphs and retaining original numbers
I need to copy numbered paragraphs from multiple documents. The paragraphs are inconsistent and may be numbered using text, MS Word multi-level list styles or listnum fields. I can search the documents, find the needed paragraphs and copy them to a new document, but when I do, the numbering resets according to the destination document's contents. How do I retain the source document's numbering in the destination document so the reader can determine where in the source document the paragraph came from? Can I convert all the numbering to text before pasting without affe...

string fields in smartlist to be able to searched by number
Current functionality in Greatplains 8 only allows the user to search on a string field however when the results are returned the data included irrelevant data and not that specified in the search. Example Item number search between 1000 and 2000 Results of search on item number 1000, 100086, 100098, 2000 the results should only return 1000 and 2000. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, fo...

row number
hi, i would like know how to return a row number or cell number thru macro. i read some other posts that had this issue, but i could not understan much. so i would be thankful if someone helped me with this. thanks, mac -- Message posted from http://www.ExcelForum.com Hi Mac Sure. Which row number did you have in mind ? For the active cell it's Activecell.Row and Activecell.Column. Best wishes Harald "icestationzbra >" <<icestationzbra.17yhgt@excelforum-nospam.com> skrev i melding news:icestationzbra.17yhgt@excelforum-nospam.com... > hi, > > i wou...

100% stacked column chart with negative numbers
How do you create a 100% stacked column chart with negative numbers? After I create the chart it only goes up to 80% How do you want it to show? The total length (including negative amount) of the column should equal 100%. (make sure you haven't limited the scale of your y-axis) What the graph is showing you is that the positive numbers do not account for 100% of your data. -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Stuck" wrote: > How do you create a 100% stacked column chart with negative numbers? After I > create th...

Jon Peltier's code: can't delete initial series??
I wrote this on my machine running Win XP and XL2002. It worked. I gave it to a friend running Win2000 and XL2000, and it fails on the code to delete the initial series. What else can we do? Ed Sub MakeNewScatterChart() Dim wkb As Workbook Dim wks As Worksheet Dim LastRow As Long Dim LastCol As Long Dim colData As Long Dim cht As Chart Dim chtObj As ChartObject Dim rngData As Range Dim rngXval As Range Dim rngSer As Range Dim strTitle As String ' Get limits of data Set wkb = ActiveWorkbook Set wks = wkb.Sheets(1) LastRow = wks.Range("A65536").End(xlUp).Row LastCol = wks....

opening unopened workbbok via code
Hi, I posted this question a while ago, but the responses I got wer unfortunately beyond my comprehension as a self-taught VBA'er! My problem was that I wanted to check if a file was open and if no open it before working on it. I developed the following code which seems to work OK. On error Goto Line1 Windows("a").Activate Goto Line2 Line 1: Workbooks.Open Filename:="C:\A.xls" Line2: ..... The problem I have is that if I need to check on more than one workboo in one sub (eg "B.xls"), I get an error message "subscript out o range" for the line, W...

HP Image Editor files default to C:\ directory
Re: HP 3970 Scanner Hello Everyone: Maybe someone here has or has used this scanner and knows the answer. I will make my question as straightforward as possible. Once I have scanned an image and 'saved it,' it defaults to the C:\ directory unless I choose another location. If it is saved in another directory, it will not show up on the image editor so I unable to print or edit the image. Is there a way to change the settings so that an image is automatically saved to a default location other than C:\ or do I have to move an image to the C:\ location each time I ...

Changing Text to Number Problem.
I have a problem when importing information into an Excel spreadsheet. We have a system at work that has a front end Web based application (asp) that accesses an SQL database. Not all of the software is written yet, so to sort/filter data I have to copy lists of information from the Web based application to an Excel spreadsheet. Much of the information that I import (copy and paste) into the spreadsheet are hyperlinks to other information in the SQL database. To get rid of the hyperlinks once I have the list copied to my spreadsheet, I (copy and paste special, values only) the information on...

Stacking data to show same number but different colors
I am needing to show two sets of data on a stacked bar that will reflect the total of the denominator. Example. I have 13 cases out of which 1 has a complication. I want the total on the bar to only reflect 13 but the coloring of the bars show both data points (13 and 1). Can this be done? Your stack total must be 13, so your differently formatted stacks have to be 12 and 1. Alternatively you could plot 13 and 1 as clustered columns, and set the overlap to 100. - Jon ------- Jon Peltier Peltier Technical Services, Inc. http://peltiertech.com/ wiggy wrote: > I am needing to sh...

Outlook 2010
I have configured a few email accounts: 1 Exchange (work) and 2 pop3/smtp (private). I can't find an option to set my exchange account as a default one for sending emails. So I often send work emails from private account - pretty annoying feature... :) Please help ...

Rounding numbers in sales receipts.
Hi there, I'm trying to modify a sales receipt so it translate a discount in $ to a discount in %, but I get numbers like this (-3.33333333333%). I need it to looks like currency but without the $ sign like this (-3.33%). Does anyone knows how to do it? Thanks, Julien ------=_NextPart_0001_207C0F12 Content-Type: text/plain Content-Transfer-Encoding: 7bit Good morning Julien, Thank you for posting your discount question. I am not sure what you are trying to calculate; but I would recommend that you take a look at the available receipt variables: Transaction.DiscountPercent...

Numbering bugs when saving Word 2007 as Word 97-2003
Using both Word 2003 and Word 2007 on Windows XP OS Okay, I've been dealing with this problem for awhile now. but it causes a lot of extra work. Half our staff use Word 2003 (home workers) and the other half have upgraded to Word 2007. I use both Word 2003 (telecommuting) and Word 2007 (office) and I do the finalizing of these files here. We share large-document files among us, so we save the files as Word 97-2003 so everyone can access. This results in numbering getting completely out of whack after you save it and reopne. Also the heading formatting is lost sometimes (b...

Programmatically Update a Form's Combo Box Default Value and SQL Record Source
I have one Sales Activity form that I use for data entry and for viewing all records by Sales Person (EmployeeID). Without having to have multiple instances of this form, I want to accomplish the below; based on which EmployeeID (sales person) opens the form in either mode: 1. For the data entry mode – I want the Combo Box’s Default Value to change, based on my user (EmployeeID); 2. Show All Records mode – I want the SQL record source to filter on that sales person’s records (EmployeeID) I’ve got some code for passwords, so I hope I can utilize that part of it; I just do not know how to do ...

outlook mail services by default
I want use outlook for my mails, but outlook express is my mail services by default. How i can restore my outlook in default mail services? ...

Changing Numbers to Text in a query
Hello, I have a number in a query that i need to change to text because my data, i.e. 555767 is being returned as 555,767 and i do not want it to contain a comma. Any ideas? Thank you! MN Perhaps you only need to change the "display" of the number, not the data type...? Regards Jeff Boyce Microsoft Office/Access MVP "MacNut2004" <MacNut2004@discussions.microsoft.com> wrote in message news:EF49F175-9640-4B44-961C-4A8EC6D5E4BB@microsoft.com... > Hello, > > I have a number in a query that i need to change to text because my data, > i.e. 555767 is b...

How can I add tabs to Bluetooth devices with windows default drive
I want to add an extension profile like FTP to windows default bluetooth driver stack and show a tab when right click on the bluetooth icon. It is said that "By impltmenting a shell proterty handler for the application" in Bluetooth Wireless Technology FAQ. I've tried that but it is only add a property sheet in Bluetooth settings, and my question is how to add a tab in the context menu just like "send a file" tab. Does it need a ContexMenuHandler and where should I registe it? ...

Add chart
Hi, Can anybody find what is wrong with this code? It will just make a empty chartobject. I believe the ranges are ok, it probably is some bad syntax or object reference... The code should make a chart with two series of xlColumnClustered and one serie of xlLineMarkers. Thank you /tskogstrom --------------------------------------- CODE: Sub UppdateChartCF() Dim cht As Chart Set cht = Sheet1.ChartObjects("R_CF").Chart On Error Resume Next '(if no chartobject) Sheet1.ChartObjects("R_CF").Delete On Error GoTo EndCode 'Left and Top location = named ranges With Shee...

Can I show a number like 1,935,674,923 as 1.9B?
I would like to reformat 10- and 11-digit the numbers (e.g. like 1,935,674,923 as 1.9B). Can this be done? Custom format: 0.0,,,"B" best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "Dave" <Dave@discussions.microsoft.com> wrote in message news:262241F3-063E-4F97-B864-A629EC670112@microsoft.com... > I would like to reformat 10- and 11-digit the numbers (e.g. like > 1,935,674,923 as 1.9B). Can this be done? Dave, Use a custom format of #.#,,,"B" or 0.0,,,"B" depending on ho...

Figuring sql server version via code
Hi Is it possible to check in .net; 1. If sql server 2008 express is installed on a machine? 2. The name of sql server 2008 express instance or instances? 3. If a particular sql server 2008 express instance contains a specific database? Many Thanks Regards You can use several methods to enumerate SQL Server instances. Here are a couple: http://msdn.microsoft.com/en-us/library/a6t1z9x2.aspx http://www.sqldbatips.com/showarticle.asp?ID=45 To determine whether a specific instance contains a certain database, you can connect to the instance's master databa...

Report codes for Matrix Parent
I'm preparing for an upgrade from QS2000 and would like to know if th following is possible. I'm testing the demo version of RMS an imported my database. I'm a shoe and apparel store and matrixes ar very important to us. My reseller has recommended the Retail Real Fashion bundle, but I would like to try something else in th meantime.. I've modified a Detailed Item Sales report and would like to ad columns for the following items associated with the Matrix Paren Item Matrix Lookup Cod Matrix Descriptio Matrix Dimension 1 (I want to see the value associated with Chil item I...