Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005

    Lightbulb Unanswered: How to get map/directions

    OK, so we kind of found this by accident, but you can use a little magic to get Access to bring up a map of an address. Let's say that you have a form with me.StreetAddress me.City and me.ZipCode being fields, then you make a button and have this procedure run on click:

    Dim strLink As String
    Dim strStandUrl As String
    Dim strStreet As String
    Dim strCity As String
    Dim strZip As String

    strStandUrl = ""
    strStreet = Me.StreetAddress
    strStreet = Replace(strStreet, " ", "+")
    strCity = Replace(Me.City, " ", "+")
    strZip = Me.ZipCode
    strLink = strStandUrl & strStreet & "+" & strCity & "+" & strZip
    Application.FollowHyperlink (strLink)

    The result would be that a map of that location would open in the default browser window courtesey of your friends at Google. I know there are easier/simpler ways, but this works. You can get directions by making another address conform to the standards (no spaces, just "+" signs) and putting a "+to+" between the two addressess. Also you could hard code in an address in the begining or the end if you're always going from one place. There are a lot of options, but it's really not too hard to start messing with this. Have fun, and use well.

  2. #2
    Join Date
    Nov 2003
    Interesting.......Thanks for your code snippit Jester6641. I'm sure some people may find this handy.

    Self Taught In ALL Environments.....And It Shows!

  3. #3
    Join Date
    Nov 2003
    LA, CA
    this is great!!! Exactly what i was trying to figure out! Thanks so much

  4. #4
    Join Date
    Nov 2007
    Adelaide, South Australia
    Hey, thanks
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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