MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How to calculate distance between 2 location with vba

This is a discussion on How to calculate distance between 2 location with vba within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-20-2004
ifc ifc is offline
Junior Member
White Belt
 
Join Date: Feb 2004
Posts: 3
How to calculate distance between 2 location with vba

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2004
ifc ifc is offline
Junior Member
White Belt
 
Join Date: Feb 2004
Posts: 3
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
calculate, distance, location, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
How to calculate distance between location and route ? tontaegu MapPoint 2006/2009 Discussion 1 10-19-2005 02:14 PM
Calculate new location from lat/lon + bearing + distance Anonymous MapPoint 2006/2009 Discussion 1 05-05-2004 08:59 AM
How to calculate distance using Mappoint and VB digish MapPoint 2006/2009 Discussion 0 02-27-2004 04:40 PM
So how do i get it to calculate teh distance betwe.... Anonymous MapPoint 2006/2009 Discussion 1 12-19-2001 08:42 AM
I would like to calculate the distance from multip.... Anonymous MapPoint 2006/2009 Discussion 1 10-31-2001 04:39 AM


All times are GMT -5. The time now is 09:11 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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