Results 1 to 4 of 4
  1. #1
    pjordan@drcog.org is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Location
    Denver, CO
    Posts
    71

    Open Google Map Using Button based on Values from 2 Text Boxes

    I have a form that has a part that has the Longitude and Latitude as two Text Boxes (TB_Lat and TB_Long).

    I would like to open Google Maps using the values of these two boxes.

    I assume I somehow use the hyperlink.follow, however I am unsure how to place in the values of TB_Lat and TB_Long into the google weblink (where values are after the q=)



    example of how I would like it to work subbing the values of TB_Lat and TB_Long below:
    maps.google.com/maps?q=TB_Lat, TB_Long

    So not sure how to do that. I don't think using the standard way of opening a page using a Command Button and putting it in the Hyperlink Address would work, or is there a way to do that using that method rather than in VB?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You'd concatenate values into the string expected by Google. Along the lines of:

    strPath = "maps.google.com/maps?q=" & TB_Lat & ", " & TB_Long

    then use that string with FollowHyperlink.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I agree with Paul's response. If you are dealing with distances between 2 zips, 2 lat/Long or 2 Postal Codes or any combination, then you may get some ideas and sample database in this link.
    Sample database in post #45.
    Good luck.

  4. #4
    pjordan@drcog.org is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Location
    Denver, CO
    Posts
    71
    Excellent that works. I looked at the sample database and used the same code format they did for the map part:

    Code:
        sLink = "http://maps.google.com/maps?f=q&hl=en&q="
        Application.FollowHyperlink sLink & TB_Lat & " " & TB_Long
    Thanks so much for the help...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Replies: 5
    Last Post: 04-01-2013, 11:49 AM
  3. Replies: 15
    Last Post: 04-01-2011, 11:41 AM
  4. Replies: 15
    Last Post: 09-18-2010, 01:19 PM
  5. Replies: 1
    Last Post: 03-27-2010, 06:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums