Solved

Obtaining coordinates using google maps with MS Access

Posted on 2010-09-10
5
1,346 Views
Last Modified: 2012-05-10
I have tried the different ways of launching IE from MS Access to allow the user to view a Google map and that works fine.  Is there any way to retrieve in MS Access the lat/long coordinates that the user points to, assuming he/she may change the location after viewing the map?  I have a Google Map API key, but don't know how I could get the coordinates. If this is not possible, could I pass and address to an API from MS Access and have the API return either an error code or the coordinates?

Thanks!
0
Comment
Question by:beehilly
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:conagraman
ID: 33653425
here are a couple of non programmatic options

1:  right on a location on the map select one of the options such as "Whats here?"
then in the bottom left corner of the page the coordinates will appear.

2: the other way i found is to get a link for the current location click on  "link"  next to print and send a box will appear with the link.

hope this helps
c1.bmp
c2.bmp
0
 

Author Comment

by:beehilly
ID: 33661890
Thank you for your help, but I need programmatic options.  Any out there?
0
 
LVL 10

Accepted Solution

by:
conagraman earned 500 total points
ID: 33665102
here you go! i almost gave up on this. there is nothing on the internet that will tell you this as far as i know.

the folks at Google are darn good at not making the coordinates in the code obvious.

The coordinates are exposed by the error handlers href.
.getelementbyid("errormessage").href

here is a sample database where i use an active x web browser to navigate to Google maps then if you press the button it will give you the original link then  extract the lat and long.

*the only problem is you will have to work on the code to extract the lat  & long. depending on what the user selects the link can be different which makes my code fail. if you play around with it you will see what i mean.

the big damage is done though with the above code.
:-)
but this should do it for you.  let me know if you need help





MYGoogle.accdb
0
 
LVL 10

Expert Comment

by:conagraman
ID: 33666435
i realized i had my lat a long  switched - so i fixed that and made the code a little better.  here you go
MYGoogle.accdb
0
 

Author Closing Comment

by:beehilly
ID: 33666766
This is working exactly how I wanted it to work.  Thank you SO much.  
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now