Driving distance calculation between two addresses that can be used in MsAccess

Is there an application that I can call from MsAccess that will return the driving distance between two addresses?
Lenny GrayAsked:
Who is Participating?
 
Jeffrey CoachmanMIS LiasonCommented:
Just FYI, ...If you just need this to show the mileage in a "Google Maps" window.
("On Demand")
You can do it easily with code like this:

Application.FollowHyperlink "https://www.google.com/maps/dir/" & Me.FullAddress1 & "/" & Me.FullAddress2

Open in new window


Create a form with two text boxes:
FullAddress1
FullAddress2
Then put the code on the click event of a button.

So, ...some something like this:
map form...will give you this:
map
You can break out the address components into separate textboxes if you like, ...but you have to concatenate them in the code individually.

I used something this to calculate my reimbursal mileage from our base location, to all our sites.

It will even take input like:
Kennedy Airport
Laguardia Airport

JeffCoachman
0
 
PatHartmanCommented:
The short answer is yes.  The long answer is I don't have any examples.  I think either MapQuest or GoogleMaps will do this.  You just have to find the API call you need.  This one might do it.

https://developers.google.com/maps/documentation/distance-matrix/

I've attached a database that maps an address using a different API.  Put an address in any record first since I removed all the real data.
CaML2K-SanatizedDataMapquestAndGoogl.zip
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Just be aware that many of the main players (Google, Map Quest, etc) have restrictions on what you can do with their API's.  For most, it's a limit on the number of calls you can make in a 24 hour period.

 If it's a commercial product that your building this into, then you'll must likely need to purchase a license.

Jim.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Lenny GrayAuthor Commented:
Thank you for your quick reply.

I opened the database but it appears to be a membership database. How do i navigate to the address screens?
0
 
PatHartmanCommented:
Sorry,  click on members, then double click on any member ID.  Don't forget to put in an address.

The example is just to show you how to use one of these API.  I have two different ways to map an address.
0
 
Lenny GrayAuthor Commented:
Pretty slick!

I'll have to check with Google for a license for their API.

Do you have any idea what that would cost?
0
 
Lenny GrayAuthor Commented:
WOW!

Jeff, that's exactly what I am looking for - just the mileage not directions.

Is the code, that you included, the only code necessary to fetch the mileage value?

Does Google have limitations on this? I am trying to do something for the company that includes a mileage calculation between two points. There will be many users daily on this. Does the company have to buy a license from Google to use its mileage calculator?

Using lat and long of postal codes is not accurate enough. I need point-to-point.
0
 
PatHartmanCommented:
Each of the API's does something different.  I only did a quick scan and picked the one that looked like it returned a number rather than a map.  There may be other options.

Many uses are free for small numbers of transactions in a time period and others require a fee.  Google can help you figure this out.
0
 
Lenny GrayAuthor Commented:
Thank you!!
0
 
PatHartmanCommented:
Let us know which API you ended up with and the cost if wasn't free.  Also, don't forget to close the question.
0
 
Lenny GrayAuthor Commented:
Google rates are not that bad, in fact virtually free, unless you are going to develop a commercial application

Google rates are not that bad. It is actually free unless you are developing a commercial application.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.