Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening IE w/ Google Maps 1

Status
Not open for further replies.

rasticle

Programmer
Sep 25, 2006
42
0
0
US
Hi,

I've look around and haven't found the answer I'm looking for. I'm trying to just open Google Maps in IE with a button in Access. I'm making some silly error that I can't seem to figure out. Just need a second set of eyes to maybe tell me what I'm doing wrong.

Code:
Private Sub google_Click()
vUrl = "[URL unfurl="true"]http://maps.google.com/maps?q="[/URL]
vUrl = vUrl & "42.5393+90.6453&t=k&iwloc=A&hl=en"
Call Shell("explorer.exe " & vUrl, vbMaximizedFocus)
End Sub

I'm obviously going to change the string so that the lat/long values are pulled from the form. It will eventually look like:

Code:
vUrl = "[URL unfurl="true"]http://maps.google.com/maps?q="[/URL]
vUrl = vUrl & me.lat.value & "+" & me.long.value & ""
vUrl = vUrl & "&t=k&iwloc=A&hl=en"

But I'm getting a warning saying:
"The path 'en' does not exist or is not a directory."

This happens when I click the button to execute this code.

Any thoughts?

Thanks,
Shawn
 
I figured it out.

I was calling the IE incorrectly.

Code:
Private Sub google_Click()
  Dim vUrl As String
  vUrl = "[URL unfurl="true"]http://maps.google.com/maps?q="[/URL] & Me.Long.Value & "+" & Me.Lat.Value & "&iwloc=A&hl=en"
  Call Shell("C:\Program Files\Internet Explorer\Iexplore.exe " & vUrl, vbMaximizedFocus)
End Sub

Worked.

Thanks anyway!
 
I was unaware of that syntax! That would save some time. =)

Thanks PHV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top