Solved

Obtaining coordinates using google maps with MS Access

Posted on 2010-09-10
5
1,391 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

832 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