Results 1 to 3 of 3
  1. #1
    MM12 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2012
    Posts
    11

    Query to apply input mask to existing records.

    I am working with a table that has a phone number field. At some point in time the field had an input mask of !999\-000\-000;0;_, so the formatting(dashes) was saved along with the entries. At some point someone changed the mask to !999\-000\-000;;_, so the formatting was not saved along with the entries. I have changed the mask back to !999\-000\-000;0;_, however I am trying to come up with a query to correctly format existing entries that were stored without the dashes.

    I tried an update query:
    Selected my table
    Dragged Phone to Field


    In Update To I have: Format("PHONE","!999\-000\-0000;0;_")
    In Criteria I have: not like "*-*"

    The correct records are being updated, but incorrectly. For example, an entry of 7181234567 is being updated to 999-000-0000 rather than 718-123-4567.

    What am I doing wrong?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,631
    That is not a valid Format parameter. Input masks and formatting are not the same thing. Also, field name should not be in quote marks. Try:
    Format([PHONE], "000-000-0000")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MM12 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2012
    Posts
    11
    Thank you for the explanation and the suggestion. It worked!

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

Similar Threads

  1. Date Input Mask in Query?
    By DelbyJones in forum Access
    Replies: 3
    Last Post: 09-01-2012, 11:08 AM
  2. Strip input mask in query results?
    By Stan Denman in forum Queries
    Replies: 1
    Last Post: 06-05-2012, 02:16 PM
  3. Input Mask
    By qbc in forum Access
    Replies: 2
    Last Post: 01-20-2012, 03:27 PM
  4. Replies: 4
    Last Post: 10-31-2010, 10:35 AM
  5. Input mask
    By doobybug in forum Access
    Replies: 2
    Last Post: 06-17-2009, 09:40 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