Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    zip code issues (Access XP)

    We worked so hard to get the City and State to automatically be entered after the zip code was enter I hate to bring up a problem.

    1. Is there any way to continue the above if you use the +4 version of the zip code? Because currently if you enter anything beyond the first five zip digits the city and state will not appear.

    2. If we get that worked out I have a second problem. Is there anyway when using the input mask for zip+4 to get rid of the "-" if there is only a 5 digit zip? I can't see Trim being used becasue the "-" isn't a space.

    The only option I see would be to break up the first five digits in one input area and the last four in another and use the IIf Is Null statement. But I have a sneaky idea there is a better way to do the job that I haven't found.

    Thanks for the help. I just wished I had a better handle on programming because I do like working with the program. Oh well I guess this is when you say practice make you better.
    Fay

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: zip code issues (Access XP)

    I am not sure I am following your questions entirely, but here goes....

    1. You are using a lookup for zip code. You can enter either a 5 digit or 10 digit zipcode. Base your lookup on the length of the zipcode. For example, if the zipcode <> length of 10 then use the short zip for the lookup, else use the entire zip. I assume your lookup table have both shortened and long zipcodes to use as the lookup.

    2. If using a query, if the length < 10 then use left(zipcode,5)

    HTH
    Regards,

    Gary
    (It's been a while!)

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

    Re: zip code issues (Access XP)

    Actually, as long as you are dealing with US zip codes, and not international post codes, the idea of breaking it into two fields should work OK. We've done it both ways, but since you are trying to maintain a list of 5-digit zips for cities, that shouldn't be too bad. Unfortunately there are some cases where ZIP codes don't follow municipal boundaries, but they are fairly rare. So a combo box for the first 5 digits and a text box for the last 4 digits and instructing the user to tab between them (or click) should work just fine.
    Wendell

  4. #4
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: zip code issues (Access XP)

    Thanks to both of you. I think I will go with the two boxes.
    Fay

Posting Permissions

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