473,537 Members | 2,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Google Maps In MS Access

Have you ever wanted to add the great features inherent in Google Maps?
Here is how you do it.

==============
== STEP ONE ==
==============

Create a new MS Access form called frmGoogleMap. Size the form to your
liking...

On the blank form, go to the "Insert" menu and select "ActiveX
Control..."

When the selection screen appears, choose "Microsoft Web Browser".

Once the control object has been placed on your form, resize the
control object WITHOUT SAVING THE FORM. The reason for this? Once you
save the form, if you want to resize after saving you have to delete
the control object and re-insert a new Microsoft Web Browser ActiveX
control object each time you want to resize it.
In this example, I have named the control object WebBrowser0.

I recommend inserting a command button named cmdClose for testing
purposes.

Once you have the Design View finished,...

a.) Set the TimerInterval for the form to 1000
b.) Go to the View menu option.
c.) Click on Code.
d.) In the Code Module for the form, insert the following code.

=<BEGIN>========================================== ===============

Option Compare Database

Private Sub cmdClose_Click()

Me.TimerInterval = 1000
MyAssigned = False
Set objBrowser = Nothing
DoCmd.Hourglass False
DoCmd.Close acForm, "frmGoogleMap", acSaveNo

End Sub

Private Sub Form_Timer()

'Declare variables.
Dim objBrowser As Object

'Set variables.
Set objBrowser = Me.WebBrowser0

If MyAssigned = False Then
DoCmd.Hourglass True
With Me.WebBrowser0
.Navigate MyGoogleMapURL
Do Until .ReadyState <> 3
DoEvents
Loop
DoEvents
Do Until .ReadyState = 4
DoEvents
Loop
DoEvents
MyAssigned = True
End With
DoCmd.Hourglass False
End If

End Sub

=<END>============================================ ===============

Save and close the new form naming it "frmGoogleMap".

==============
== STEP TWO ==
==============

Go to the Modules section of your MS Access database, and click New and
insert the following code.

=<BEGIN>========================================== ===============

Option Compare Database

Global MyAssigned As Boolean
Global MyGoogleMapURL As String

=<END>============================================ ===============

Save and close the new module naming it "Google Variables".
At this point, I will show you how Google Maps structures the URL that
retrieves a requested map.

Let's say you want to search for :

John Smith
111 West Gable Lane
Dayton, OH 45410

When you go to Google Maps at http://maps.google.com, you type in the
address and Google goes to...

"http://maps.google.com/maps?q=111+West+Gable+Lane+Dayton+OH+45410&iwloc=A &hl=en"

Now to pass this value to your new form, set your MyGoogleMapURL
variable to the above URL and open the new form like this:

MyGoogleMapURL =
"http://maps.google.com/maps?q=111+West+Gable+Lane+Dayton+OH+45410&iwloc=A &hl=en"
DoCmd.OpenForm "frmGoogleMap", acNormal

Obviously, you can parse the string value of the URL to any address of
your choosing.

Programmer's Note(s) And/Or Warnings:

If you're connecting to your new Google Maps form through a Citrix
connection, the opening of the Microsoft Web Browser control will crash
your MS Access database. This is because Google Maps will turn your
SpeedScreen setting on in Citrix, even if you have it set to Off, and
the combined running of both creates a GPF error.

You CAN, however, use a standard Remote Desktop Connection(RDC) or a
VNC connection with no resulting crashing of MS Access.

For additional business purposes, you can also have your MS Access
application target different types of businesses nearby (Example :
Schools) just by setting the URL string value to something like...

"http://maps.google.com/maps?q=schools+loc%3A+111+West+Gable+Lane+Dayton+O H+45410&f=l&hl=en"

I hope this helps you in your development process.

If you have any questions, feel free to contact me at:

Sean Dorman
se*********@yahoo.com

Nov 13 '05 #1
3 61008
I almost forgot to mention...the difference between showing the map in
"Satellite" view, as opposed to the "Map" view, is in how you end the
URL sent to the Google Map form you have created.

The "Map" view URL ends like this...
"...+fresno+ca+93711&iwloc=A&hl=en"

The "Satellite" view URL ends like this...
"...+fresno+ca+93711&t=k&iwloc=A&hl=en"

Again, I hope this helps.

Sean Dorman
se*********@yahoo.com

Nov 13 '05 #2
Haven't tried it yet, but the concept sounds very good.

Thanks.

--
Darryl Kerkeslager
Nov 13 '05 #3

Sean wrote:
Once the control object has been placed on your form, resize the
control object WITHOUT SAVING THE FORM. The reason for this? Once you
save the form, if you want to resize after saving you have to delete
the control object and re-insert a new Microsoft Web Browser ActiveX
control object each time you want to resize it.


I find that this code sizes (for width) my browser control quite
satisfactorily:

Private Sub Form_Open(Cancel As Integer)
Me.wbHDSBHelp.Width = Me.Width
End Sub

I think we are talking about the same control? Perhaps, I am
misunderstanding.

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2972
by: Sam Carleton | last post by:
Ok, over the years I have read about doing web programing and I have done some real basic stuff. Now I am digging into some real ASP.Net 2.0 and am totally lost some things. I have a master page setup and that is working great. On my contact page I would like to use Google Maps API Version 2 to show a map to my location. Below is the...
17
4598
by: MeerkatInFrance | last post by:
There comes a time when you know you are not going to be able to work something out yourself, however hard you try. I have reached that moment. I have a master page and a slave page (or whatever one calls it) All I want to do is show a Google map on the slave page. The map that Google gives as an example when it gives you a key would be...
0
1048
by: jbarbeau | last post by:
I have a VB.net database for storing points and information about them using Google Maps. I need to encode these points using the Google API in Javascript. I made functions to pass the data on the URL string with a redirect after the lookup. It works fine until the URL gets bigger than 2085 chars. (for IE). How can I pass the data without...
4
5707
by: phanimadhav | last post by:
hai this is sudheer.I don't know how to use googlmaps .I am serching in net but its not working in my application one error was occur at the executionTime Objectexpected.This is the url http://www.codeproject.com/useritems/Use_of_Google_Map.asp <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ...
0
1462
by: joaorbraposo | last post by:
Hi! I'm creating an application using C# and I need to display one or more markers in a webBrowser object using Google Maps. The problem is that I was thinking to create only one HTML file that I could change automatically everytime I need to display something. Like this I need to edit this file with the right code (HTML and JavaScript) and...
1
1366
by: Anthony2oo5 | last post by:
Iv been searching for a way to get the distance in miles from one location to another, and thought the best way is using google maps. Back in the day I did this by using a curl command and regular expressions (I know cringe) but im looking into using googles API for it. Searched the web and found this: ...
4
1965
omerbutt
by: omerbutt | last post by:
hi there i need to use google maps to show my location on my contact us page ,havent done that that before ever any help or guidance will be appreciated ,i some how read somewhere that we need to give the longitude or latitude for the location but i donot exactly know the procedure reagrds, Omer Aslam
6
16156
by: mfaisalwarraich | last post by:
Hi everyone, I am trying to add multiple pinpoint to google map using Lon/Lat. All addresses will be fetched from mysql database using PHP. I have looked at google and searched for it on various sites but nothing helpful i found. i have used the following code which worked for only one address whereas i have alot of addresses. ...
0
7361
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7531
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7275
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7642
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5824
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.