Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass data to Mapquest

Status
Not open for further replies.

pepperca

Programmer
Mar 7, 2002
47
0
0
US
I have a form with a customers address. I would like to pass this information to Mapquest. Is there a way to do this?

Any help is appreciated.

Thanks,

Cindy
 
pepperca,

This may get you started. See help text on Application.FollowHyperlink

Code:
' Hyperlink for the map @ MapQuest
Application.FollowHyperlink
"[URL unfurl="true"]http://www.mapquest.com/maps/map.adp?country=US&countryid=250&addtohistory=&address="[/URL] 
& Mod_Street & city = Mod_City & State = Mod_State &  zipcode ="&submit=Get+Map"

I hope this helps..

[thumbsup2]
 
Sorry, you will need this.

NOT TESTED! A friend emailed this to me months ago.

Code:
Dim Mod_Street As String
Dim Mod_City As String
Dim Mod_State As String

'Populate variable from your form
Mod_Street = frmYours.Address   
Mod_City = frmYours.City
Mod_State = frmYours.State

'  Rmv any preceeding and/or trailing spaces
Mod_Street = RTrim(Mod_Street)
Mod_City = RTrim(Mod_City)
Mod_State = RTrim(Mod_State)
Mod_Street = LTrim(Mod_Street)
Mod_City = LTrim(Mod_City)
Mod_State = LTrim(Mod_State)

'  Replace remaining spaces with a + in each string
Mod_Street = Replace(Mod_Street, " ", "+", 1, , 1)
Mod_City = Replace(Mod_City, " ", "+", 1, , 1)
Mod_State = Replace(Mod_State, " ", "+", 1, , 1)

' Hyperlink for the map @ MapQuest
Application.FollowHyperlink
"[URL unfurl="true"]http://www.mapquest.com/maps/map.adp?country=US&countryid=250&addtohistory=&address="[/URL] 
& Mod_Street & city = Mod_City & State = Mod_State &  zipcode ="&submit=Get+Map"



[thumbsup2]
 
Thanks for the info. I just got around to trying it and could not get it to work. It does not like Application.FollowHyperlink.

Cindy
 
Shouldn't this:
"& Mod_Street & city = Mod_City & State = Mod_State & zipcode ="&submit=Get+Map"
Be replaced by something like this ?
"& Mod_Street & "&city=" & Mod_City & "&state=" & Mod_State & "&zipcode=&submit=Get+Map"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top