Linking Maps.google.com to a form in a Access Database to produce

G

Guest

Hi,

I'd like to do the following:

Create a link inside of a form where there is an address field to
automatically upon request by pushing a command button to produce a map from
map.google.com, brought up in a separate browser. This should produce a
separate map for each client, without having to type in the address myself.

Any assistance would be helpful.

Thanks.
 
G

Guest

Happy to help out. This is actually a pretty straightforward matter.

Assuming that:
1. Your database has a straightforward structure like [Address], [City],
[State], [Zip],
2. Your installation of Internet Explorer is in the standard location,

Then create a form with these fields. Then build a command button with the
following event procedure;

(Actually, I cheated and used a Command Button Wizard, for "Run Application"
and the plugged in the path to Internet Explorer and Google Maps.)

-----------------------------------------------------------------
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stAppName As String

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.com/maps?f=q&hl=en&q=" & Me.Address & ", " & Me.City & ",
" & Me.State

' this was all one line; this message form wrapped it.....



Call Shell(stAppName, 1)
Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub
 
G

Guest

Ken, Cna you help me please. I have the same requirement, but using only one
address field called 'Run_point_Address_A', but when I try to use it with
your event procedure, nothing happens?

the procedure I am using is a copy of yours with a slight adjustment to the
field, as follows:

Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stAppName As String

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.com/maps?f=q&hl=en&q" = "Me.Run_point_Address_A"

' this was all one line; this message form wrapped it.....

Call Shell(stAppName, 1)
Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub


Private Sub Command158_Click()

End Sub


I really am stumped as to what the problem is; I know the button works if I
leave out the 'field syntax' and just have the command line to call
ieExplorer & googlemaps. it calls up a browser and loads google maps, but I
just can't seem to get it to apply my address field details.

any help you can give will be appreciated.

regards

Eric





Ken Mitchell said:
Happy to help out. This is actually a pretty straightforward matter.

Assuming that:
1. Your database has a straightforward structure like [Address], [City],
[State], [Zip],
2. Your installation of Internet Explorer is in the standard location,

Then create a form with these fields. Then build a command button with the
following event procedure;

(Actually, I cheated and used a Command Button Wizard, for "Run Application"
and the plugged in the path to Internet Explorer and Google Maps.)

-----------------------------------------------------------------
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stAppName As String

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.com/maps?f=q&hl=en&q=" & Me.Address & ", " & Me.City & ",
" & Me.State

' this was all one line; this message form wrapped it.....



Call Shell(stAppName, 1)
Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub

-------------------------------------------

Hope this helps!


fascal said:
Hi,

I'd like to do the following:

Create a link inside of a form where there is an address field to
automatically upon request by pushing a command button to produce a map from
map.google.com, brought up in a separate browser. This should produce a
separate map for each client, without having to type in the address myself.

Any assistance would be helpful.

Thanks.
 
G

Guest

Looks like you may have a typo.

In line
stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.com/maps?f=q&hl=en&q" = "Me.Run_point_Address_A"

change it to read

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.com/maps?f=q&hl=en&q=" & Me.Run_point_Address_A

Again, make this all one line (or use the line continuation character "_")

Your formula

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.com/maps?f=q&hl=en&q" = "Me.Run_point_Address_A"

fails because you have two equalities but no concatenation operator "&".
 
G

Guest

Thanks Ken,

You're a star!

the other (hidden) problem I had was the reference 'Private Sub
Command13_Click()' that i pasted verbatim from your original post, once i had
reset it to my button reference 'Private Sub Command160_Click()' all was ok.
It now works, and i really would like to say a huge thanks for your help, and
to also say I am a complete novice with VBA (hence my elementry button ref
error).

regards

Eric
 
G

Guest

You are welcome. We learn by doing; try and tweak, try and tweak. I myself
have received far more help in these groups than I will EVER be able to
repay. But someday, you'll read a question here and say "Hey! I know this
one!".

In return for my help here, you are required to answer!

Have a great weekend.
 
G

Guest

Hi Ken,

Can you help me to further tweak your solution for a WebBrowser on a form.

I have setup the MS ActiveX Webrowser on a form, and want to be able to take
the data from a field control from a tabbed form. At the moment i have the
following code on a 'on click event' set for a button on the same tab page
as the WebBrowser control:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q= &
[Form_Run_Points subform].Run_point_Address_D"

The WebBrowser works fine, and loads a googlmaps page, but doesn't seem to
parse the data form the control on the other subform tab page.

What do you think I am doing wrong?
 
G

Guest

Sorry; when it comes to ActiveX controls, I am clueless. Best of luck.

efandango said:
Hi Ken,

Can you help me to further tweak your solution for a WebBrowser on a form.

I have setup the MS ActiveX Webrowser on a form, and want to be able to take
the data from a field control from a tabbed form. At the moment i have the
following code on a 'on click event' set for a button on the same tab page
as the WebBrowser control:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q= &
[Form_Run_Points subform].Run_point_Address_D"

The WebBrowser works fine, and loads a googlmaps page, but doesn't seem to
parse the data form the control on the other subform tab page.

What do you think I am doing wrong?




Ken Mitchell said:
You are welcome. We learn by doing; try and tweak, try and tweak. I myself
have received far more help in these groups than I will EVER be able to
repay. But someday, you'll read a question here and say "Hey! I know this
one!".

In return for my help here, you are required to answer!

Have a great weekend.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top