Getting Yahoo Map out of address on a form

M

Media Lint

Yep, you're welcome

' Display a map of the specified street adress using yahoo
maps
Public Sub YahooMapAddress(StreetAddress As String,
ZipCode As String)
Screen.MousePointer = vbHourglass
DoEvents
On Error GoTo err_YahooMapAddress
Dim strTemp As String
' **** If yahoo maps website changes, the following line
may need to be modified ****
strTemp = "http://maps.yahoo.com/py/maps.py?
BFCat=&Pyt=Tmap&newFL=Use+Address+Below&addr=" & _
SpaceToPlus(StreetAddress) & "&csz=" & ZipCode
& "&Country=us&Get%A0Map=Get+Map"
Application.FollowHyperlink strTemp, , True
exit_YahooMapAddress:
Screen.MousePointer = vbNormal
Exit Sub
err_YahooMapAddress:
Screen.MousePointer = vbNormal
' ShowGenericError "General", "Public Sub
YahooMapAddress(StreetAddress=" & StreetAddress & _
", ZipCode=" & ZipCode & ")", Err.Number,
Err.Source
Resume exit_YahooMapAddress
End Sub

' When passing an internet command string it is often
necessary to replace spaces with
' plus signs: of particular utility when calling dynamic
CGI and ASP based web scripts
Public Function SpaceToPlus(strText As String) As String
On Error GoTo err_SpaceToPlus
Dim rVal As String, sC As String
Dim n As Integer
For n = 1 To Len(strText)
sC = Mid(strText, n, 1)
If sC = " " Then sC = "+"
rVal = rVal + sC
Next n
SpaceToPlus = rVal
exit_SpaceToPlus:
Exit Function
err_SpaceToPlus:
' ShowGenericError "General", "Public Function
SpaceToPlus(strText=" & strText & ")", Err.Number, _
Err.Source
Resume exit_SpaceToPlus
End Function
 

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