Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Mar 2004
    Location
    White Oak, Pennsylvania, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a form that displays constituent addresses and have a command button that will allow the user to look up directions from our place of business to the address of the constituent.

    Previously, MapQuest would display a map of the area and also have the text directions.

    Not, it appears that MapQuest has changed someting and they only display a world map with the text directions.

    Is there a different way of sending the request to MapQuest than the code I am using - listed below - or should I investigate another map provider?

    Private Sub cmdGetMap_Click()
    Dim strMap As String
    '
    ' Load FEFC location into string as starting point
    '
    strMap = "http://www.mapquest.com/directions/main.adp go=1&do=nw&un=m&cl=EN&ct=NA&rsres=1&1y=US&1a=4001+ university+Drive&1c=McKeesport&1s=PA&1z=15132&1ah= &2y=US&2a="
    '
    ' add the destination to the string
    '
    strMap = strMap & Me.txtAddress1 & "&2c=" & hldCity & "&2s=" & hldState & "&2z=" & hldZip
    '
    ' Get the map from Mapquest
    '
    Application.FollowHyperlink strMap
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try

    strMap = "http://www.mapquest.com/maps?1c=Mckeesport&1s=PA&" & _
    "1a=4001+University+Drive&1z=15132&2c=" & hldCity & _
    "&2s=" & hldState & "&2a=" & Me.txtAddress1 & "&2z=" & hldZip

  3. #3
    Star Lounger
    Join Date
    Mar 2004
    Location
    White Oak, Pennsylvania, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hans,

    Thanks. However, there must be some problem with MapQuest taking a call from Access code.

    Your code (and many other variations I have tried) still results in the global map being displayed. However, if I copy the link and paste it into a new tab, all variations work properly. Guess that'll have to be a work around temporarily.

    If you have any oher thoughts or a suggestions regarding another site to use, I'd appreciate it.

    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I did try it from Access, with success:

    [attachment=85332:x.png]
    Attached Images Attached Images
    • File Type: png x.png (62.4 KB, 0 views)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You might try Google Maps - see Google Map Parameters - Google Mapki.

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    [quote name='jstegman' post='791455' date='31-Aug-2009 08:49']Hans,

    Thanks. However, there must be some problem with MapQuest taking a call from Access code.

    Your code (and many other variations I have tried) still results in the global map being displayed. However, if I copy the link and paste it into a new tab, all variations work properly. Guess that'll have to be a work around temporarily.

    If you have any oher thoughts or a suggestions regarding another site to use, I'd appreciate it.

    John[/quote]
    It used to work fine for me, but I just tried it and got the same error you got. I made a slight modification, and this works:

    Application.FollowHyperlink "http://www.mapquest.com/maps?" & varMap & "&country=US&cid=lfmaplink"

    Where varMap = "&address=4001+University+Drive&city=McKeesport&st ate=PA"
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •