This article explains how to integrate/embed Google map in MS access 2010 using VBA code. To implement this concept in Microsoft Access VBA knowledge is required.
This article is about to embeded google map using MS Access form. Firstly we have to select a blank form and from toolbar click on activeX contols option as shown in Fig 1.1
A small pop up will open and we have to select on "microsoft web browser" option as shown in Fig 1.2
After the selection of "microsoft web browser" the form design view is look like Fig 1.3. TimerInterval Property of form. Then write VBA code for this form at the end of article.
Create new form and insert button on the form as shown in Fig 1.4. On "click" button event We have to giving path of address that we want to open.
Whenever we select "click" button on form2 then control will go to Form1. And It will show the google map of the giving address as shown in Fig 1.5
VBA code for Form1:-
Private Sub cmdClose_Click()
Me.TimerInterval = 1000
MyAssigned = False
Set objBrowser = Nothing
DoCmd.Close acForm, "From1", acSaveNo
Private Sub Form_Timer()
Dim objBrowser As Object
Set objBrowser = Me.WebBrowser0
If MyAssigned = False Then
Do Until .ReadyState <> 3
Do Until .ReadyState = 4
MyAssigned = True
VBA code for Form2:-
Private Sub Command0_Click()
DoCmd.OpenForm "Form1", acNormal
VBA code for Module:-
Option Compare Database
Public MyAssigned As Boolean
Public MyGoogleMapURL As String
It is advised that the information provided in the article should not be used for any kind formal or production programming purposes as content of the article may not be complete or well tested. Access Guru will not be responsible for any kind of damage (monetary, time, personal or any other type) which may take place because of the usage of the content in the article.
Copyright © 2019 ERP Makers