Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Posts
    6

    Unanswered: Can zip code be numeric field?

    Hi,

    I'm trying to get a zip code field to display the left zero and it keeps dropping it. Of course the text field works great, but I'd like to use the numeric field for sorting purposes.

    I tried using the input mask with left fill symbol then 5 required digits /- and then 4 optional. Everything pushed off to the right with no left zero.

    Is there a work around for a left zero or am I limited to text?

    Thanks! Deb

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by Deb K
    Hi,

    I'm trying to get a zip code field to display the left zero and it keeps dropping it. Of course the text field works great, but I'd like to use the numeric field for sorting purposes.

    I tried using the input mask with left fill symbol then 5 required digits /- and then 4 optional. Everything pushed off to the right with no left zero.

    Is there a work around for a left zero or am I limited to text?

    Thanks! Deb
    Hi Deb K and "Welcome to the Forum"

    Let me make sure I understand you well. You have a ZipCode field that you want to be able to display a "0" as the first digit? Correct?

    Now, that being the case you also want to be able to sort it? Correct?

    You have to use the TextField type to use the ZipCode input mask wizard. But even so you can use the TextField. Then create a Query based on that table and in it, sort the ZipCode field to Ascending or Descending. Your form that you later make will carry that over when you base it on that Query.
    Is that what you were needing? If that's not quite it come back and I will try again.

    enjoy the forum
    have a nice one,
    Bud

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    OH, and one other thing, if that is the last field you are inputting data into, then go to Form/DesignView and go to the Field Properties for that ZipCode field. Click on the EventTab then go to AfterUpdate. Click on the three dots and then select CodeBuilder. Once that opens, TAB twice and simply put in this work: Requery That's it. What happens then is each time you leave that field it Requeries that field and puts all the zips in order. However, if that's not the last field of entry, just do it on whatever is the last entry point.

    have a nice one,
    Bud

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by Deb K
    Hi,

    I'm trying to get a zip code field to display the left zero and it keeps dropping it. Of course the text field works great, but I'd like to use the numeric field for sorting purposes.

    I tried using the input mask with left fill symbol then 5 required digits /- and then 4 optional. Everything pushed off to the right with no left zero.

    Is there a work around for a left zero or am I limited to text?

    Thanks! Deb
    Hi Deb K and "Welcome to the Forum"

    Let me make sure I understand you well. You have a ZipCode field that you want to be able to display a "0" as the first digit? Correct?

    Now, that being the case you also want to be able to sort it? Correct?

    You have to use the TextField type to use the ZipCode input mask wizard. But even so you can use the TextField. Then create a Query based on that table and in it, sort the ZipCode field to Ascending or Descending. Your form that you later make will carry that over when you base it on that Query.
    Is that what you were needing? If that's not quite it come back and I will try again.

    enjoy the forum
    have a nice one,
    Bud

  5. #5
    Join Date
    Oct 2004
    Posts
    6

    Can zip code be numeric field?

    Hi Bud,

    Thanks for the reply. Yes, I do want a 0 to be the first digit in the zip code (there are zip codes around NYC with a 0).

    The problem that I was expecting with the text field is that they no longer are in numerical order - instead of 1,2,3 you get 1,10,2. However,
    I just realized that if all the fields have the same number of digits, then that probably won't be an issue - since the text will fix the left zero.

    I just went to Excel to test it and it didn't sort text numbers that way. I wonder if that's something they changed in the 2002 version (I have 1997 at work, I believe). I'm confused.

    Anyway, I'll try the mask with the text field - it sounds like it should be work.

    Thanks, Bud!

    Deb

  6. #6
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi Deb,

    Yes, the way I explained it above would work. I created one here and works fine and the sorting with the Zero's as well. Take a look at the sample db I created and posted here for you in Access 2000 version. Open the form and input a ZipCode. Start with any number you want, and then as soon as you leave that field it Requeries that field and puts them all in Ascending order.

    have a nice one,
    Bud
    Attached Files Attached Files

  7. #7
    Join Date
    Oct 2004
    Posts
    6

    Can zip code be numeric field?

    Thanks, Bud. I dont have db at home so I'll have to take it to work to look at it. I appreciate the help.

    Deb

Posting Permissions

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