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 2 of 2

How to find the right

This is a discussion on How to find the right within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, I've got a really simple question but it's a real problem for me to find a solution. I'd like ...

  1. #1
    Vincent BENNER's Avatar
    Vincent BENNER is offline Member Yellow Belt
    Join Date
    Sep 2002

    How to find the right


    I've got a really simple question but it's a real problem
    for me to find a solution.

    I'd like to put a pushpin into a map with the FindAddressResults
    or FindResults methods.

    What I know : the STREET, the ZIP CODE and the CITY.

    When I make such a test :

    Dim objPIN As MapPoint.Pushpin
    Dim objFR As MapPoint.FindResults

    Set objFR = Me.ctrlMAPPOINT.ActiveMap.FindAddressResults("RUE DE LA MAIRIE", "DIJON", , , "21000", "FRANCE")
    Set objPIN = Me.ctrlMAPPOINT.ActiveMap.AddPushpin(objFR.Item(1) , "TEST")
    objPIN.Symbol = 5

    The street named "RUE DE LA MAIRIE" doesn't exist in the DIJON city. So, mapPoint puts a PushPin to about 300 kms for the DIJON city !!!!

    What's wrong in my code ?


    Vincent BENNER

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002

    Give this sample a try, hopefully it will get you on the right track...

    in this example I have 2 forms. Form1 has the map, this code is in a
    command button on form2 along with 4 textboxes. a command button on
    form1 opens form2.

    text1 - Street Address
    text2 - City
    text3 - State
    text4 - Zip

    Dim objmap As MapPointctl.Map
    Set objmap = Form1.MappointControl1.ActiveMap
    Dim objFR As MapPointctl.FindResults

    Set objFR = objmap.FindAddressResults(Text1.Text, Text2.Text, ,
    Text3.Text, Text4.Text, geoCountryUnitedStates)

    If objFR.ResultsQuality = geoFirstResultGood Then
    objmap.AddPushpin objFR.Item(1), "Good Result"

    'show other matches if any
    For i = 1 To objFR.Count
    MsgBox objFR.Item(i).Name
    End If

    Insted of showing the msgboxes you could make the textboxes on form2
    combo boxes, then in the for next loop take the "objFR.Item(i).Name"
    and parse it with ParseStreetAddress method and fill the combo boxes
    with the results.

Thread Information

Users Browsing this Thread

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

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