Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passing URL to Google

16 views
Skip to first unread message

ardy

unread,
Aug 31, 2011, 2:01:05 AM8/31/11
to
I have found a code that suppose to pass collected variables from text
boxes in a form to construct a URL and pass it onto a web browser and
locate the address in google map. the code executes with no error but
no browser opens up. any help is appreciated.......
if this is a wrong group please point me to the right one.
------------------------Start-------------------------------
Private Sub GoogleMapsLink_Click()

Dim strLinkUrl As String
Dim strPath As String
Dim strAddr() As String

strPath = "http://maps.google.com/maps?q="

strLinkUrl = RTrim(streetnumber.Value) & "+" & RTrim(city.Value) & "+"
& RTrim(state.Value)
strAddr = Split(strLinkUrl, " ", , vbTextCompare)
strLinkUrl = ""
For i = LBound(strAddr()) To UBound(strAddr())
strLinkUrl = strLinkUrl & strAddr(i) & "+"
Next i
strLinkUrl = strPath & Left(strLinkUrl, Len(strLinkUrl) - 1)
Debug.Print strLinkUrl
Me.GoogleMapsLink.HyperlinkAddress = strLinkUrl

End Sub
------------------------------------------------
End------------------------------------------------

XPS350

unread,
Aug 31, 2011, 2:15:53 AM8/31/11
to
You have to add a command to actually follow the hyperlink:
Me.GoogleMapsLink.Hyperlink.Follow


Peter
http://access.xps350.com/

ardy

unread,
Aug 31, 2011, 10:30:10 AM8/31/11
to

Hello Peter:
Thank you very much for replying. I am not a programmer by trade. I
have tried both Me.GoogleMapsLink.Hyperlink.Follow = strLinkUrl and
Me.GoogleMapsLink.HyperlinkAddress.Follow = strLinkUrl. I get no
result. Under the Debug I Tried to compile and get the following
Compile Error.
----
Me.GoogleMapsLink.Hyperlink.Follow = strLinkUrl => >Follow gets
Highlighted and I get Compile Error Dialog box "Expected Function or
Variable"

Me.GoogleMapsLink.HyperlinkAddress.Follow = strLinkUrl =>
HyperlinkAddress gets Highlighted and I get Compile Error Dialog box
"Expected Function or Variable"
----
I am using Access 2007, Any insight........

Ardy

XPS350

unread,
Aug 31, 2011, 11:21:22 AM8/31/11
to
I haven't tried it, but I think adding the line of code to your code will do.

So:
.
.
Me.GoogleMapsLink.HyperlinkAddress = strLinkUrl
Me.GoogleMapsLink.Hyperlink.Follow

Peter

ardy

unread,
Aug 31, 2011, 1:23:45 PM8/31/11
to

OK This Worked
Me.GoogleMapsLink.HyperlinkAddress = strLinkUrl

it seems that we don't need the .Follow

Thanks for all your help

0 new messages