Open Ms Access from Google Earth

Hi Darbid,
Hope you are good. Though am still carrying out a personal research on my last post to you, i can still do with a little help.

Thanks buddy, i have learnt quite a lot through you.
CHEERS!!!
 
hey hows it going now. I have been on holidays so I have not been playing with Access.

Finished?
 
Hi Darbid,
Hope you are good. Though am still carrying out a personal research on my last post to you, i can still do with a little help.

Thanks buddy, i have learnt quite a lot through you.
CHEERS!!!

Hi Kent,

Good day! Have you able to finish this project? I have thought to do the same but i wasn't able to finish it.

Hope i could get some tips from you.

br,
 
Hi darbid,

I'm trying to do the same as this, could you please assist me.

I have subform which consist of IDs and coordinates, and i would like to add your GE browser as additional subform.

I would like to goto specific IDs and located it in the GE subform. How should i start from your code?

Thanks.

ivan
 
Do you have a website which hosts your google earth? Thus are you registered with Google for earth?
 
Do you have a website which hosts your google earth? Thus are you registered with Google for earth?

No I don't have, I only be using it only in a sub form in access. It is possible to have it? Thanks!
 
No it's impossible with my methods. Go back to the beginning and then it links to another post. But you need an Internet page under my method.
 
No it's impossible with my methods. Go back to the beginning and then it links to another post. But you need an Internet page under my method.

If I have installed GE on my local PC, it is possible to have that GE to be part of my sub form in access?
 
I did that many years ago and am not sure if it is still possible. It mean taking the window from GE and then putting it into Access, this means using the Windows API. But it is really not a good solution and in my opinion a hack. But as I said I did it years ago.

This thread and my linked thread with a web page is the best way in my opinion.
 
PS. If you are looking for some nice active x control that you drag and drop into your form which is Google Earth then give up now. I am pretty sure that will never exist.
 
So what is your advice?

I saw some of your discussion here, I would like to know if I'll be using the web browser for my GE to be attached in my subform, how could I able to search specific location in that GE?
 
So what is your advice?

read this thread and this one http://www.access-programmers.co.uk/forums/showpost.php?p=820225&postcount=1

1. you need to create a website.
2. you need an account with google and apply for google earth
3. you need to create google earth in HTML and java script on that webpage
4. you need to have java script methods on that page which you can call from your VBA code
5. you need a web browser in your sub form
6. you need to point it to your web page
7. you need to then call the functions you have built on that webpage from your vba.

If you just have a couple of points and only want to show one at a time then the easy way is to just call google maps with a URL that will show one point. The only reason I used Google Earth was because I could have multiple points, use KML files and fly around.
 
read this thread and this one http://www.access-programmers.co.uk/forums/showpost.php?p=820225&postcount=1

1. you need to create a website.
2. you need an account with google and apply for google earth
3. you need to create google earth in HTML and java script on that webpage
4. you need to have java script methods on that page which you can call from your VBA code
5. you need a web browser in your sub form
6. you need to point it to your web page
7. you need to then call the functions you have built on that webpage from your vba.

If you just have a couple of points and only want to show one at a time then the easy way is to just call google maps with a URL that will show one point. The only reason I used Google Earth was because I could have multiple points, use KML files and fly around.

thanks for your help.

I tried some of the helps from above replies, and made it based on my requirements.

I only getting this error "This program cannot display the webpage" after pressing the button which directs to specific long/lat on my table.

How should i fix it?

br,
ivan
 
what is your link to your webpage?

What do you mean link?

I have this code below, please take a look.

Dim mydoc As MSHTML.HTMLDocument
Dim virginbrowser As Boolean
Dim NAVcounter As Integer

Dim po_Lat As Single
Dim po_Long As Single
Dim po_Alt As Single
Dim ge_Speed As String

Dim conID As String

Dim GE_flight_rs As DAO.Recordset
Dim GE_flight_ok_move_next As Boolean

Private Sub btn_fly_contracts_Click()
Call GE_next_flight_point
End Sub

Private Sub form_load()
On Error GoTo err_handler

virginbrowser = True 'set this to stop the first couple of navigations that take place
NAVcounter = 1 'this counts the navigates before we want to trap the navigates

'*****************NEED TO CHANGE THIS to the path of the html page****
Me.WebBrowser4.Navigate CurrentProject.path & "\trial.html"
Set mydoc = Me.WebBrowser4.Document

'form_load:

Exit Sub:

err_handler:
MsgBox _
"An unexpected error has been detected" & Chr(13) & _
"Description is: " & Err.Number & " , " & Err.Description & Chr(13) & _
"Please note the above details before contacting support"
'Resume form_load
End Sub

Private Sub GE_next_flight_point()
On Error GoTo Err_GE_next_flight_point

ge_Speed = 1
ge_Speed = Replace(ge_Speed, ",", ".")

po_Alt = 10000

po_Lat = Forms![Main]![Lat]
po_Long = Forms![Main]![Long]

Call mydoc.parentWindow.execScript("pointtour('" & po_Lat & "','" & po_Long & "','" & po_Alt & "'," & _
ge_Speed & ")", "Jscript")


Exit_GE_next_flight_point:
Exit Sub

Err_GE_next_flight_point:
MsgBox Err.Description
Resume Exit_GE_next_flight_point
End Sub


Private Sub WebBrowser4_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
On Error GoTo Err_WebBrowser4_BeforeNavigate2

NAVcounter = NAVcounter + 1

Debug.Print NAVcounter

'when I test this there are 3 navigates to get GE started. So from 4 onwards we need to capture it.
If NAVcounter > 4 Then

Dim strfrombrowser As String

Cancel = True ' always need this

Debug.Print "Full URL" + URL

'get just my information
strfrombrowser = Right(URL, (Len(URL) - InStrRev(URL, "\")))


'this is just the code
Debug.Print "Before Navigate left 2 URL - " & Left(strfrombrowser, 2)

Select Case Left(strfrombrowser, 2)

Case "03"
GE_flight_ok_move_next = True
Debug.Print "In select Called"
Call GE_next_flight_point

End Select

End If

Exit_WebBrowser4_BeforeNavigate2:
Exit Sub

Err_WebBrowser4_BeforeNavigate2:
MsgBox Err.Description
Resume Exit_WebBrowser4_BeforeNavigate2

End Sub
 
What happens when you load the HTML file into IE or FF? It might work locally now but eventually you must have a publically accessible web page. B
 
What happens when you load the HTML file into IE or FF? It might work locally now but eventually you must have a publically accessible web page. B


actually when loading it shows the whole GE in that form, but when i click it the button it will directly goes to the long/lat but when it reach the point it will show the error "This program cannot display the webpage". Then click the button again it will give the script error with url: "res://ieframe.dll/dnserrordiagoff_webOC.htm" then shows the "Automation error"
 
click what and what events in your form happen?

button name "btn_fly_contracts"

after clicking it will eventually goes to the long/lat (slowly showing in the GE webbrowser) then it stop and gives the error.
 
ok can you cut and copy the full code in btn_fly_contracts and if this calls a function on the html page then the full code of the function it calls.
 

Users who are viewing this thread

Back
Top Bottom