Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Posts
    304
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Applying Input Mask after the fact (Access 2003)

    If I apply an Input Mask to a field after I've already got data in it, is there a quick way to apply the mask to the pre-existing data. It appears to only work on data entered after the mask is created.

    Thanks - Sat.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Applying Input Mask after the fact (Access 2003)

    Do you mean that you'd like to insert the fixed characters used in the input mask? There is no built-in way to do that, you'd have to create an update query for it.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Applying Input Mask after the fact (Access 2003)

    Have you tried an update query?

    Update To: Format([fieldname], "mm/dd/yyyy")

    Or whatever the specific format you're trying to apply is.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  4. #4
    3 Star Lounger
    Join Date
    Apr 2001
    Posts
    304
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Applying Input Mask after the fact (Access 2003)

    Jeremy and Hans - thanks for the point in the right direction. Jeremy, specifically I'm trying to go back and apply a phone number input mask to format numbers as (555) 555-5555. I attempted to use your example and plug in that format instead, but believe I'm using incorrect syntax. Could you help. I typed (without quotes):
    "Format([Phone Number],(###) ###-####)"

    and am getting an error. Should I be using a different symbol (instead of #). Thanks.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Applying Input Mask after the fact (Access 2003)

    I think the problem you have is that you want to store the "Area Code" with the parens, so you need to put quotes around them. So your statement should look like:
    <font color=blue><font face="Georgia">Format([Phone Number], "(###) ###-###)")</font color=blue></font face=georgia>
    Having said that, we found that unless your numbers are specifically restricted to the North American Dialing plan (10 digits), it gets to be a real pain to try to do this kind of thing. We resorted to storing all of the format characters in the actual text string, and ran a bunch of error checking and formating code after the number was entered. Hope this helps.
    Wendell

  6. #6
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Applying Input Mask after the fact (Access 2003)

    You should use:

    Format([phone number],"(###)###-####")
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  7. #7
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Applying Input Mask after the fact (Access 2003)

    Oops...didn't realize you'd posted...

    Wendell, I use the same sorts of error checking in my data entry forms, so that everything is entered correctly the first time....

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>Well....almost everything
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •