Results 1 to 3 of 3
  1. #1
    evanesce is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    3

    Simple Format Question

    Hi.
    I am just into MS Access 2010.
    I live in South Korea.
    I have a question about the field format.

    [Story]
    Some old cell phone numbers here have 10 digits like this;
    011-123-4567 or 017-123-4567 or 018-123-4567 or 019-123-4567.
    Some numbers have 11 digits like this;
    011-1234-5678 or 017-1234-5678 or 018-1234-5678
    Most of the numbers are 11 digit numbers like this;
    010-1234-5678

    If I put 10 digit numbers, I want it to be showed like 011-123-4567.
    If I put 11 digits, I want it to be like 010-1234-5678 or 011-1234-5678.

    How can I do this?



    I was thinking about this for an hour.
    Still can't find out the answer.
    Any help will be greatly appreciated.

    Thank you very much again in advance.
    Please help!

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Query? Form?

    Here is some VBA:

    If Len(Me!Text0) = 10 Then Me!Text2 = Format(Me!Text0, "000-000-0000")

  3. #3
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Where would you be entering these numbers?
    Would it be in a Form?

    Didn't see aytee111's post - sorry.

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

Similar Threads

  1. A simple question:
    By kosti in forum Queries
    Replies: 4
    Last Post: 10-12-2011, 11:46 AM
  2. Simple VBA Question
    By koper in forum Access
    Replies: 1
    Last Post: 01-20-2011, 12:07 PM
  3. Simple question
    By KenM in forum Queries
    Replies: 1
    Last Post: 11-10-2009, 03:32 PM
  4. Simple question?
    By roads.zx in forum Access
    Replies: 0
    Last Post: 10-15-2009, 04:56 PM
  5. Very simple question!
    By fiddley in forum Programming
    Replies: 2
    Last Post: 04-28-2009, 02:16 AM

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