Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Entering a number as text (2000)

    I want a field to enter a number in the following format: 1234 567 89 001. That is, 12 digits separated by spaces. Because it's such a large number I've created it as a text field. However, I would like an input mask like 0000 000 00 000 - but this doesn't work correctly because it is a text field. How can I resolve this, hopefully without any programming? Andrew

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Entering a number as text (2000)

    I don't understand why the input mask of "0000 000 00 000" won't work. If you put that in the input mask property of a control, Access will change it to "0000 000 00 000". You will then have to enter precisely 12 digits before you can exit the field. What do you mean by "this doesn't work correctly"?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Entering a number as text (2000)

    Input Masks are meant expressly for text and date fields, so can you explain what doesn't work?

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Entering a number as text (2000)

    Andrew

    In design view of the table, you can go to the field propertis and use the Input mask wizard.I tried it and got the follwing result in the Input mask area. Give me a shout if you need more:

    0000 0000 0000 0000;0;

    Jerry
    Jerry

  5. #5
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Entering a number as text (2000)

    What I mean is that I would like to enter, for example 2102, and for Access to change this to 0000 000 02 012. Andy.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Entering a number as text (2000)

    Are you talking about changing it in the display or storing it in that format? You can create a display format that will display it that way, and their is a wizard for that similar to the input mask wizard. If you want to actually store the value in that format, you need to either use an input mask as well or write some code However, display formats can look pretty strange if the underlying data has its own formatting built in.
    Charlotte

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

    Re: Entering a number as text (2000)

    It's a pretty weird input mask OR format that would change 2102 to 2 012. Apart from that, you would probably need code to do what you want in a text field.

    Have you considered using a Currency or Numeric / Double Precision field? You can set the format to 0000 000 00 000 then.

  8. #8
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Entering a number as text (2000)

    Brilliant! Using a Currency Data Type I can set the Format property to 0000 00 etc.., and entering 2012 converts to 0000.. 2 012 as required. I didn't realise Currency would allow upto fifteen digits before the decimal. Thanks, Andy.

Posting Permissions

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