Selasa, 02 Juli 2013

[MS_AccessPros] Re: Google Maps and Access

 


Art - I got this a long time ago. Can't find the source.

Sub sMapQuest(strAddress As String, strCity As String, strState As String, strZipCode As String)
'Purpose : Show map of given address.
'DateTime : 9/17/2008 09:31
'Author : Rob Shuster
'Requires : Internet Explorer
Dim strURL As String
Dim ie As Object

If InStr(1, strAddress, "#") <> 0 Then 'Remove everything after # - mapquest does not like
strAddress = Left(strAddress, InStr(1, strAddress, "#") - 2)
End If

Do While IsNumeric(Nz(Right(strAddress, 1), 0)) 'remove any righthand numbers/spaces - mapquest does not like
strAddress = Left(strAddress, Len(strAddress) - 1)
Loop

strAddress = Replace(strAddress, " ", "+") 'Convert spaces to +
strCity = Replace(strCity, " ", "+")
strState = Replace(strState, " ", "+")

strURL = "http://www.mapquest.com/maps/map.adp?country=US&addtohistory=" 'build URL
strURL = strURL + "&address=" + strAddress
strURL = strURL + "&city=" + strCity
strURL = strURL + "&state=" + strState
strURL = strURL + "&zipcode=" + strZipCode
strURL = strURL + "&homesubmit=Get+Map"

Set ie = CreateObject("InternetExplorer.Application")

ie.Navigate strURL
ie.Visible = True

End Sub

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

--- In MS_Access_Professionals@yahoogroups.com, "Art" <dbalorenzini@...> wrote:
>
> Is there a way to incorporate a google map in a form based on address fields (address, city, state, zip) in a table?
> So basically I would like to see the following on my form;
>
> Work
> 123 Main Street
> Sioux Falls, SD 57103
>
> [Map Here]
>
> Home
> 456 Maple Street
> Sioux Falls, SD 57103
>
> [Map Here]
>
> Any ideas would be great.
>
> Thank you
>
> Art Lorenzini
> Sioux Falls, SD
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
.

__,_._,___

Tidak ada komentar:

Posting Komentar