Results 1 to 8 of 8
  1. #1
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209

    Syntax to have phone numbers display


    I tried using the input mask for a phone number field, but it isn't catching all of the numbers. Is there a way to hard code into a query to have a number field display as (000) 777-0000?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I'd make your phone number field a text value not a numeric value.

    In a query you can set the display format just like you did with an input maps, just go to the properties of the phone number field, set the input mask to phone number and select the option that allows you to display the field with the mask applied.

  3. #3
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    How do I set the display format in the query like you mention above?

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    With your query open in design view, right click on the field and select properties.

    Alan

  5. #5
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    I set the input mask for the field in my query as
    Code:
    !\(999") "000\-0000;0;_
    (which is what the prompts set is as after following the guide)
    And it is still not displaying all of the 10 digit phone numbers in that format. They are all text fields. Any ideas why?

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    when you set up the input mask it should ask you if you want your data to be displayed that way as well (as per my previous post) are you not getting that prompt? Try removing the input mask and doing it again because you should be prompted to confirm if you want your data to be displayed in the same format as your input mask. If not you can always set it up on your table the same way.

  7. #7
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    When I set up the input mask it asks me how I want my data displayed and I select the(000) 000-0000 setting. I have tried setting it up as the input mask of my table, as well as the input mask of my query and it is not setting "All" data in those fields to that format, just most of them. I can continue to do the formatting in excel, i was just trying to alleviate a step, but doesn't want to work out.

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    What's the difference between the ones it is correctly formatting and the ones it's not formatting? It won't just randomly do it there has to be a reason. Is it the number of digits in the phone number? if it's not formatting the ones that may only have 7 digits (no area code) add the area code to those phone numbers and you should be fine.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Customer Phone List Example form
    By pkstormy in forum Code Repository
    Replies: 2
    Last Post: 05-06-2017, 03:06 PM
  2. Custom format for phone#
    By SmokingMan in forum Access
    Replies: 4
    Last Post: 08-02-2010, 10:41 PM
  3. Phone number format
    By ManvinderKaur in forum Access
    Replies: 1
    Last Post: 06-24-2010, 08:07 AM
  4. Phone number in (000) 000-0000
    By Ajay in forum Queries
    Replies: 9
    Last Post: 03-12-2010, 11:50 AM
  5. Dialing Phone Numbers From Access
    By obrmb in forum Forms
    Replies: 0
    Last Post: 06-11-2009, 12:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums