Hi , i have map point 2004 and access, and i want to take data in my, db 2 locations and i want that map point calculate the distance and give me back the result so i can store it in my db.
how can i automate this ???
Thanks in advance
This is a discussion on How to calculate distance between 2 location with vba within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi , i have map point 2004 and access, and i want to take data in my, db 2 locations ...
Hi , i have map point 2004 and access, and i want to take data in my, db 2 locations and i want that map point calculate the distance and give me back the result so i can store it in my db.
how can i automate this ???
Thanks in advance
Here is the code to do that (distance between 2 Postal Code (Zip) ) i finaly find it
Code:Sub GetKm() Set oApp = New MapPoint.Application Set oMap = oApp.NewMap Set oLoc(1) = oMap.FindAddressResults("", "mons", , , "7000", "Belgium") Set oLoc(2) = oMap.FindAddressResults("", "namur", , , "5000", "Belgium") Set Loca(1) = oLoc(1).Item(1) Set Loca(2) = oLoc(2).Item(1) If Not oLoc(1) Is Nothing Then 'Check to see if the first address was found. If Not oLoc(2) Is Nothing Then 'Check to see if the second address was found Debug.Print oMap.Distance(Loca(1), Loca(2)) End If End If Set oMap = Nothing Set oApp = Nothing End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)