Access and Mapquest

D

DS

Anyone know how to bring up a Map in Access from Mapquest based on an
address field in Access?
Thanks
DS
 
J

Jeff Conrad

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/m­ap.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/m­ap.adp?country=US&addtohistory­=&address...

The first line, "http://www.mapquest.com/maps/m­ap.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=&addr­ess=601+Travis&city=Houston&st­ate=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/m­ap.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]
 
D

DS

Jeff said:
in message:




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/m­ap.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)
WOW! This is good stuff, Its sure to keep me busy! When I'm done with
what I'm writing now I'll get to work on it. I'll let you know how it
works out. Once again, Thank You!
DS
 
J

Jeff Conrad

in message:
WOW! This is good stuff, Its sure to keep me busy! When I'm done with
what I'm writing now I'll get to work on it. I'll let you know how it
works out. Once again, Thank You!

You're welcome, glad to help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top