Link to Map Site

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyWaterloo
    New Member
    • Dec 2007
    • 135

    Link to Map Site

    I am trying to duplicate an affect I found in a contacts database I downloaded from Access. There is a little map button that will open up Bing.com and show the address location of the address of the contact. I would really like to duplicate this in a database I am working on. Unfortunately I can't get this function to work. Has anyone ever done this? Is there code I can run or a macro? I tried copying the macro from the example database but it won't work in mine. How do I tell access to go to a website and enter the address info into the sites search parameters? Any help would be greatly appreciated.
  • mshmyob
    Recognized Expert Contributor
    • Jan 2008
    • 903

    #2
    Here is how I do it for google maps
    [code=vb]
    Private Sub cmdMap_Click()
    Dim strURL As String
    strURL = "http://maps.google.com/maps?q=" & Me.txtAddrStree t & ",+" & Me.txtAddrCity & ",+" & txtAddrProv & "+" & txtAddrPostal & "+" & txtAddrCountry
    Application.Fol lowHyperlink strURL

    End Sub[/code]
    This is the format for google maps. You may need to change the string for the site you want.

    cheers,

    Comment

    • MyWaterloo
      New Member
      • Dec 2007
      • 135

      #3
      Originally posted by mshmyob
      Here is how I do it for google maps

      [code=vb]
      Private Sub cmdMap_Click()
      Dim strURL As String
      strURL = "http://maps.google.com/maps?q=" & Me.txtAddrStree t & ",+" & Me.txtAddrCity & ",+" & txtAddrProv & "+" & txtAddrPostal & "+" & txtAddrCountry
      Application.Fol lowHyperlink strURL

      End Sub
      [/code]

      This is the format for google maps. You may need to change the string for the site you want.
      cheers,
      Thanks! That works perfect for google maps. I tried it with http://www.bing.com/maps/?FORM=Z9LH8 and I get sent to the site correctly, but it won't pass along the address info into the sites search fields. Google maps is great but bing.com has the option for "birdseye view" which is much more detailed. I really would like to be able to end my client to this site. Any ideas?

      Comment

      • MyWaterloo
        New Member
        • Dec 2007
        • 135

        #4
        Looks like I found the correct URL: http://www.bing.com/maps/default.aspx?where1=. This allows my address info to be passed along to the site correctly. As always, thanks for all the help.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32661

          #5
          As the parameter to the FollowHyperlink command is in exactly the same format as the URL you'd use in a browser you can go and browse for what you want, then look at the URL created and implement that in your code.

          Comment

          Working...