469,328 Members | 1,316 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

Access and Google Earth

JDW
Maybe a stupid plan, but I want by double clicking on a field in a Form,
export an address to the search box of Google Earth and fly to this
address...

Who can help me with the event procedure of the address-field ?

Thanks

JD
Belgium
Europe.

Jan 23 '07 #1
12 8551
I do something similar to pull-up Yahoo map from a double click on an
address field.

Call Shell("C:\Program Files\Internet Explorer\iexplore.exe
"http://maps.yahoo.com/py/maps.py?Pyt=Tmap&addr=" & Me![Address] & "&csz=" &
Me![City] & "+" & Me![State] & "+" & Me![Zip] &
"&Get%A0Map=Get+Map", vbMaximizedFocus)

I copied the address from IE, appending information from my database. When
Yahoo changes there application, this command will need to be updated.

"JDW" <jd******@skynet.bewrote in message
news:45***********************@news.skynet.be...
Maybe a stupid plan, but I want by double clicking on a field in a Form,
export an address to the search box of Google Earth and fly to this
address...

Who can help me with the event procedure of the address-field ?

Thanks

JD
Belgium
Europe.

Jan 23 '07 #2
This post may help (if the link doesn't work search for "Sean Dorman Google
Map"). Works for Google Maps.

http://groups.google.com/group/comp....f0aadbaf5e959b
--
Darryl Kerkeslager

"JDW" <jd******@skynet.bewrote
Maybe a stupid plan, but I want by double clicking on a field in a Form,
export an address to the search box of Google Earth and fly to this
address...

Who can help me with the event procedure of the address-field ?

Jan 24 '07 #3
MLH
Hmmm??? I get RunTime error #438 =="Object doesn't
support this property or method" when the following line
is executed:

..Navigate MyGoogleMapURL

Must be that I'm using A97, huh? Will this work with A97
with modifications?

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Tue, 23 Jan 2007 20:14:22 -0500, "Darryl Kerkeslager"
<ke*********@comcast.netwrote:
>http://groups.google.com/group/comp....f0aadbaf5e959b
Jan 24 '07 #4
Sorry. Not sure; I have only tested it on A2000, and no longer have A97
installed.
--
Darryl Kerkeslager

"MLH" <CR**@NorthState.netwrote
Hmmm??? I get RunTime error #438 =="Object doesn't
support this property or method" when the following line
is executed:

.Navigate MyGoogleMapURL

Must be that I'm using A97, huh? Will this work with A97
with modifications?

Jan 25 '07 #5
MLH
Oops. I'll catch up one day.
Jan 26 '07 #6
JDW wrote:
Maybe a stupid plan, but I want by double clicking on a field in a Form,
export an address to the search box of Google Earth and fly to this
address...

Who can help me with the event procedure of the address-field ?

Thanks

JD
Belgium
Europe.
Did the responses provide you with a solution? If not, I'll post one
for you.
Jan 27 '07 #7
MLH
I would appreciate seeing a solution I might adapt
to an A97 platform with some minor mods.

>Did the responses provide you with a solution? If not, I'll post one
for you.
Jan 28 '07 #8
MLH wrote:
I would appreciate seeing a solution I might adapt
to an A97 platform with some minor mods.
>>Did the responses provide you with a solution? If not, I'll post one
for you.
I have an unbound form (I can pass the initial data to) with the
following fields; Address, State, City, Zip and the command button
DisplayMap. I had read a post about a year+ indicating how to do it in
this newsgroup and I modified it for my needs.

Private Sub CommandDisplayMap_Click()
On Error GoTo Err_CommandFindAddress_Click

If Not IsNull(Me.City) And Not IsNull(Me.State) Then
'Declare variables.
Dim strURL As String
Dim objBrowser As Object

'create the string to pass to google maps
strURL = CreateUrl()
strURL = "http://maps.google.com/maps?q=" & strURL &
"&iwloc=A&hl=en"

Dim obj As Object
Set obj = CreateObject("InternetExplorer.Application")
With obj
.Navigate2 strURL
.Visible = True
End With
Set obj = Nothing
Else
MsgBox "You need to supply at least the city and state.", ,
"Missing Info"
End If

Exit_CommandDisplayMap_Click:
Exit Sub

Err_CommandDisplayMap_Click:
MsgBox Err.Description
Resume Exit_CommandDisplayMap_Click

End Sub

Private Function CreateUrl() As String
'generate the URL to pass to Google in browser.
Dim strURL As String
Dim strOrig As String
Dim intPos As Integer

If Not IsNull(Me.Address) Then
'parse out the address elements. Ex:
'123 Somewhere St = 123+Somewhere+St
strOrig = Me.Address
Do While True
If strOrig <"" Then
intPos = InStr(strOrig, " ")
If intPos 0 Then
strURL = strURL & Left(strOrig, intPos - 1) & "+"
strOrig = LTrim(Mid(strOrig, intPos + 1))
Else
strURL = strURL & strOrig & "+"
Exit Do
End If
Else
Exit Do
End If
Loop
End If
strURL = strURL & Me.City & "+" & Me.State & "+"
If Not IsNull(Me.ZipCode) Then strURL = strURL & Me.ZipCode & "+"

CreateUrl = Left(strURL, Len(strURL) - 1)

End Function
Jan 28 '07 #9
MLH
Crud! I'm getting an Automation error: System cannot find
file specified when this line runs:
Dim obj As Object <
Are there issues with References I should be paying attention to?
Jan 28 '07 #10
MLH
Perhaps I've got this line wrong:

Set obj = CreateObject("MozillaFireFox.Application")

??? I was just guessing at it ???
Jan 28 '07 #11
MLH wrote:
Perhaps I've got this line wrong:

Set obj = CreateObject("MozillaFireFox.Application")

??? I was just guessing at it ???
Does FireFox have an application model that you can use in VBA?
Jan 28 '07 #12
MLH
That I cannot say. Will try to find out.
Thx.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Sun, 28 Jan 2007 19:15:36 GMT, salad <oi*@vinegar.comwrote:
>MLH wrote:
>Perhaps I've got this line wrong:

Set obj = CreateObject("MozillaFireFox.Application")

??? I was just guessing at it ???

Does FireFox have an application model that you can use in VBA?
Jan 29 '07 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by El Benjamino | last post: by
2 posts views Thread by Bell, Kevin | last post: by
1 post views Thread by xahlee | last post: by
1 post views Thread by John Walsh | last post: by
2 posts views Thread by Sheikko | last post: by
reply views Thread by service2online | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.