Open Google or Bing Maps to coordinates in text box

Hdata

Registered User.
Local time
Today, 03:52
Joined
Sep 10, 2013
Messages
56
Hello and thank you for this forum

I have an access database where I can open a Bing Map from an address located in text boxes (street Address, City, State, zip, CountryorRegion.

My question is how could I revise this code to open a Bing Map or Google Map from Lat/Long Coordinates located in a textbox?


Function OpenMap(Address, City, State, Zip, CountryOrRegion)
Dim strAddress As String
strAddress = Nz(Address)
strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(City)
strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(State)
strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(Zip)
strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(CountryOrRegion)

If strAddress = "" Then
MsgBox "There is no address to map."
Else
Application.FollowHyperlink "http://maps.live.com/default.aspx?where1=" & strAddress
End If
End Function
 
Last edited:
Do you understand that code at all? Ultimately you are building a URL. You need to check with live.com to see what a URL that uses lat\long should look like and then make your string produce something that conforms.
 
??? Should your post's title be???

Open Google or Bing Maps from coordinates in text box
 
Thank you, your suggestion for title is much better.
 
I have a couple of older routines that work with Google Maps.

You need Lat and Long to 6 digits to get an address (at least that's what I've found).
I went to Google maps and zoomed in on Witchita, KA and clicked an address. Google tells me the Lat/Long.
I entered those values in my function and it returned the proper address-as below.

?AddrFromLatLong(URLEncode("37.678592,-97.379461"))
3140 W University St, Wichita, KS 67213, USA

I also did same with a Tunbridge Wells, UK address

?AddrFromLatLong(URLEncode("51.134881,0.239740"))
5 Harmony St, Tunbridge Wells TN4 8NS, UK

Good luck.
 

Users who are viewing this thread

Back
Top Bottom