in message:
Anyone know how to bring up a Map in Access from Mapquest based on an
address field in Access?
Here are a couple of past post on the subject from MVP Doug Steele and
angelic MVP Cheryl Fisher. Hopefully this will help:
I'd create a string that represents the URL:
Dim strLookup As String
Dim strURL As String
If Len(Me.City) > 0 Then
If Len(strLookup) > 0 Then
strLookup = strLookup & "&"
End If
stLookup = strLookup & "city=" & Replace(Me.City, " ", "+")
End If
If Len(Me.State) > 0 Then
If Len(strLookup) > 0 Then
strLookup = strLookup & "&"
End If
stLookup = strLookup & "state=" & Replace(Me.State, " ", "+")
End If
If Len(Me.Address) > 0 Then
If Len(strLookup) > 0 Then
strLookup = strLookup & "&"
End If
stLookup = strLookup & "address=" & Replace(Me.Address, " ", "+")
End If
and so on until you've looked at each field of interest.
strURL =
http://www.mapquest.com/maps/map.adp
If Len(strLookup) > 0 Then
strURL = strURL & "?" & strLookup
End If
I'd then copy the code from
http://www.mvps.org/access/api/api0018.htm at
"The Access Web", and call it like:
strReturn = Call fHandleFile(strURL, WIN_NORMAL)
[/QUOTE][/QUOTE]
[/QUOTE]
The following has worked for me ...
First, enter an address into the MapQuest address fields and click the
Search button. Then, copy the entire URL and paste it into Notepad or
Wordpad so that you can look at it.
For example, if you were searching for:
601 Travis
Houston, TX 77002
the complete URL would look like the following:
http://www.mapquest.com/maps/map.adp?country=US&addtohistory=&address...
The first line, "
http://www.mapquest.com/maps/map.adp?" is fixed so it
needs no change. For the address, you will need to use your field values to
construct a string that looks just like the rest of the URL:
"country=US&addtohistory=&address=601+Travis&city=Houston&state=TX&zipcode=7
7002&homesubmit=Get+Map"
Then, you can use the following (untested) to get to the map page:
Dim strLinkPath as string
Dim strExtra as string
strLinkPath = "
http://www.mapquest.com/maps/map.adp?"
strExtraInfo = ' string with your search values
Application.FollowHyperlink Address:=strLinkPath,
extrainfo:=strExtra,NewWindow:=True
The same process should work for Reverse Telephone Lookups.
hth,[/QUOTE][/QUOTE][/QUOTE]