Access & MAPQUEST

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have a client who wants "To"/"From" directions with mileage on his service
order reports, generated by an Access DB front end. Is there any way to
automate a query to MAPQUEST using fields on an open data entry form as
inputs for "To" and "From" addresses, and return the output to a report in
the database?
 
I'd recommend going with Microsoft Mappoint as it was designed for that
AND provides integration with the OFFICE applications via VBA. I have
only done some curosry discovery as to the automation, but it is
possible and not any difficult than learning another application. For
further assistance the MapPoint can help you out. There have been
multiple Access/MapPoint threads.

microsoft.public.mappoint

FYI here's some of the code from the discovery, it was written from
within WORD since I didn't want to create an *.mdb file. The code took
about 1/2 hour to put together without any prior knowledge of the
Mappoint Object Model. I did have to snoop around the HELP file, but I
don't think that 30 minutes is all that bad given that I was starting
from scratch.

Sub Macro5()

Dim appMapPoint As MapPoint.Application
Dim mpMap As MapPoint.Map
Dim mpFindResults As MapPoint.FindResults
Dim mpLocation As MapPoint.Location
Set appMapPoint = CreateObject("Mappoint.Application")
Set mpMap = appMapPoint.NewMap
Set mpFindResults = mpMap.FindAddressResults("250 East Michigan
Street", "Orlando", , "FL", 32806, geoCountryUnitedStates)
Set mpLocation = mpFindResults.Item(1)
mpMap.AddPushpin mpFindResults.Item(1), "Home"
mpMap.SaveAs Application.ActiveDocument.Path & "\test_map.ptm",
geoFormatMap, True
appMapPoint.Quit

End Sub
 
The COOL thing is that there's a MapPoint ActiveX Control which will
allow you to do mapping from within Access. Supposedly there have more
than a couple of instances of people incorporating it into their DBs.
 
Back
Top