I gave you the code to make your form work how you want it to. But,
following on from Larry Linson's point that you would be better learning
how
to do it rather then just copying some code, I have given details below.
Please ask your friend to translate anything you don't understand.
______________________________________________
Using Google maps is no different to using any other hyperlink to a
webpage
- with one big different to (some) pages. With Google Maps you (normally)
want the map to be of somewhere specific (in your case of France) and to
have a pointer pointing at something.
Use this as a practice.
Create a new form in design view.
Put 1 button on it (call it butGMaps ). Put a text box on the form (call
it txtCodesPostle).
Load this into the OnClick event of butGMaps
Private Sub butGMaps _Click()
Dim MyHyperlink As String
Dim strGoogleLoaction As String
strGoogleLoaction = Replace([txtCodesPostale], " ", "+")
MyHyperlink
="
http://maps.google.co.uk/maps?g=q&hl=en&geocode=&time=&date=&ttype=&q="
&
strGoogleLoaction & "&ie=
UTF8&ll=45.447125,6.978335&spn=0.012796,0.043087&z=15"
Application.FollowHyperlink MyHyperlink
End Sub
As you can see this is almost the same as I posted to you in another post.
But (again following Larry Linson's advice) you would be better
understanding
this code - so you can create your own.
So lets break down the code and work out how to create your own Google
Maps
pointer.
This section just tells your application to do something when you click a
control (in this case butGMaps )
Private Sub butGMaps _Click()
This section is used to define the 2 variables. Dims are used to dinfine
variables and can be used elsewhere in the form (or in the application if
used in a public module)
Dim MyHyperlink As String
Dim strGoogleLoaction As String
So MyHyperlink and strGoogleLoaction can be changed (which is what
variable
means in English - I may wrong about the translation. If I am someone
else
will tell you)
This section tells your application to "follow" (go to) the place that you
have declared in your DIM variable
Application.FollowHyperlink MyHyperlink
This is the section that some people who are new to Access and Google Maps
have problems with
strGoogleLoaction = Replace([txtCodesPostale], " ", "+")
MyHyperlink
="
http://maps.google.co.uk/maps?g=q&hl=en&geocode=&time=&date=&ttype=&q="
&
strGoogleLoaction & "&ie=
UTF8&ll=45.447125,6.978335&spn=0.012796,0.043087&z=15"
So we can break it down
strGoogleLoaction = Replace([txtCodesPostale], " ", "+")
This section replaces spaces (if there are any) with a + sign. This is
important as HTTP code (like used in Google Maps) will replace spaces with
%
and not a +. But of course if there are no spaces then it will not do
anything
The next section (which in your code should all be on one line)
MyHyperlink
="
http://maps.google.co.uk/maps?g=q&hl=en&geocode=&time=&date=&ttype=&q ="
&
strGoogleLoaction & "&ie =
UTF8&ll=45.447125,6.978335&spn=0.012796,0.043087&z=15"
Is actually 4 sections
This section tells your application that this is the variable hyperlink
MyHyperlink =
This section open Google Maps (and a few other things like setting the
Geocoded time - for more info on this search Google on Geocode)
http://maps.google.co.uk/maps?g=q&hl=en&geocode=&time=&date=&ttype=&q
This section inserts the variable you have put into your text box
& strGoogleLoaction & "&
This section tells Google Maps "which" maps to open and at what scale
UTF8&ll=45.447125,6.978335&spn=0.012796,0.043087&z=15
THAT IS THE SECTION YOU NEED TO CHANGE if you need another map - "not" the
post code, zip code, codes postle, etc
So let say you live in the USA and you want to open a map of New York
Here is a cheat you can use that is very simple
If you open Google Maps and zoom in to the New York area then select the
"Link to this page" icon you can cut this
http://maps.google.co.uk/maps?hl=en&ie=UTF8&ll=40.784701,-73.861084&spn=0.883826,2.757568&z=9
You then cut out the section of this hyperlink "includeing and all after
the
UFT" (Unicode Transformation Format) so you will get this
UTF8&ll=40.784701,-73.861084&spn=0.883826,2.757568&z=9
For Paris you would have this
UTF8&ll=48.819524,2.406006&spn=0.38429,1.378784&z=10
For the whole of Italy you would have this
UTF8&ll=42.455888,13.425293&spn=6.888257,22.060547&z=6
You need to add this section to your code so it looks like this (for New
York)
Private Sub butGMaps _Click()
Dim MyHyperlink As String
Dim strGoogleLoaction As String
strGoogleLoaction = Replace([txtCodesPostale], " ", "+")
MyHyperlink
="
http://maps.google.co.uk/maps?g=q&hl=en&geocode=&time=&date=&ttype=&q="
&
strGoogleLoaction & "&ie=
UTF8&ll=40.784701,-73.861084&spn=0.883826,2.757568&z=9"
Application.FollowHyperlink MyHyperlink
End Sub
Or like this for paris
Private Sub butGMaps _Click()
Dim MyHyperlink As String
Dim strGoogleLoaction As String
strGoogleLoaction = Replace([txtCodesPostale], " ", "+")
MyHyperlink
="
http://maps.google.co.uk/maps?g=q&hl=en&geocode=&time=&date=&ttype=&q="
&
strGoogleLoaction & "&ie=
UTF8&ll=48.819524,2.406006&spn=0.38429,1.378784&z=10"
Application.FollowHyperlink MyHyperlink
End Sub
Don't forget that if you insert a post code, zip code, codes postle that
is
not on the map it will not be seen as it is out side the area.
I hope this helps you with you application
--
Wayne
Manchester, England.
Piere Garmond said:
English checked by Graham Watson (from London) now living in Val
'dIsere -
"but" not changed in any way unless shown
_________________________________________
Dear members (P said Dear Mr and Mrs)
I have spoken to my English friend who has informed me that the word
"Racist" that I used in my last letter to this forum was wrong. The
original
French word I used was "biased" and my limited English skills altered the
entire focus of my letter by using the wrong translation.
I am truly sorry for any offence I have caused (many people put that in
letters and on signs - but I really do mean it). I did not mean to imply
that any individuals were against me due to my country of origin.
(P said everyday - I have change it to truly - Graham)
I still truley believe that this forum and the majority of the Microsoft
"empire ?" plays lip service to other languages as a marketing tool.
This
forum is "by far" the most used Access forum on the MS network.
My letter to you made it sound like I wanted my work doing for me, this
is
not what I intended. I was mealy trying to point out that if a question
is
asked in English it is more likely to receive an answer than if asked in
other languages.
I want to make a special apology to Mr Larry Linson as I used the word
"Angry" to refer to him response to my original post. I should have used
"Curt" or "prompt". This means he told me very firmly and quickly to
learn
to use the program. He was correct in this. So once again I am sorry to
you
Mr Larry Linson.
As for Mr Arron Kempf - we have people like this in France also - I will
say
no more.