Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Error in VBA automation of MapPoint when PO BOX is found

This is a discussion on Error in VBA automation of MapPoint when PO BOX is found within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello everyone, Okay, I have a quick question for all of you. I'm using VBA in access to create maps... ...

  1. #1
    JPeters is offline Junior Member Yellow Belt
    Join Date
    Jul 2002
    Posts
    12

    Error in VBA automation of MapPoint when PO BOX is found

    Hello everyone,
    Okay, I have a quick question for all of you. I'm using VBA in access to create maps... and my maps will appear fine with pushpins in the location of each record... however, if the automation process comes upon a single PO BOX in the address field of a record- Access stops the mapping process and delivers an error message... I was wondering if any of you know a solution to this problem.

    I had considered writing an algorithm that checks the first 6 chars of the address string and sees if it's "PO BOX" or "PO BIN", but unfortunately I'm a much better java programmer than a VBA programer, and I'm not very good at manipulating the string object class in VBA. I could write the code in java in less than a minute so it can't be too tough to write in VBA. Has anyone ever done something like this and could throw the snippit of code my way? Otherwise I'm going to start hittin the books and read up on VBA strings.

    I'm hoping that there is an easier way to do this... Considering only 15 of the records in about 5000 have po box in the address field, this is a pain for such little benefit, but it has to be done. Maybe I can write some sort of a query, I don't know... I just need a good shove in the right direction. Thanks much.

    -Josh
    ---------------------------
    -JPeters-
    jpeters@guidemail.com
    ---------------------------

  2. #2
    JPeters is offline Junior Member Yellow Belt
    Join Date
    Jul 2002
    Posts
    12
    Fixxed it ... well, this is a simpler fix for my direct problem since I'm only fixing 15 records and any records post this date will not allow po boxes to be entered in the address field... so this works for me. But I might suggest a more extensive solution for someone with a more elaborate problem. Perhaps scan the entire string for the word Box and if it exists create an input box popup for the user to view the address and ask him whether to include it or not, if his answer is yes, then add the record, else move next ... Instruct your users to not allow po boxes, and you can even include this in the popup ... and then if the user accidentally clicks yes on a po box, you can have some error control in your module. I hope this helps someone in the future.

    If Left(MapRST!Address, 4) <> "PO B" Then 'Catches Bin or Box
    Mapping comands here...
    End If
    MapRST.MoveNext

    -Josh
    ---------------------------
    -JPeters-
    jpeters@guidemail.com
    ---------------------------

  3. #3
    JPeters is offline Junior Member Yellow Belt
    Join Date
    Jul 2002
    Posts
    12
    Might i add that you'll want to convert the entire address string to capital letters to avoid case sensitive problems.... I did in my solution, just forgot to type that code in. It's easy to do. And the reason why we search for BOX is to eliminate the error of P.O. versus PO.

    Just some ideas, maybe it'll help someone somday..

    -Josh
    ---------------------------
    -JPeters-
    jpeters@guidemail.com
    ---------------------------

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MapPoint Automation with C/C++ - Part 1
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 10
    Last Post: 09-15-2006, 10:01 AM
  2. MapPoint Automation with C/C++ - Part 2
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 1
    Last Post: 09-20-2005, 10:00 AM
  3. Addresses not found for MapPoint 'isMached'!
    By pileggi in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-24-2005, 10:09 AM
  4. Automation -- Unable to kill mappoint.exe
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-03-2004, 10:12 PM
  5. I am using Mappoint with Visual C++ via automation....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-08-2002, 01:07 AM

Tags for this Thread

Posting Permissions

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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83