Hey. So. Google Maps Links can either be created using the coordinates or your can search for specific places.
Here is an example of a google maps link:
This will show the Place Dieburg in Germany
(64807 is the post code, Dieburg is the name of the city and Lessingstrasse is the street name. DE is the country code for germany.)
So what you want to do is something like this. Lets say you have a web view called "browser".
Code:
Dim postCode As String 'Of cause you need to assign something to these variables
Dim countryCode As String
Dim street As String
browser.ControlSource = "=""https://www.google.com/maps/place/" & postCode & "+" & street & "+" & countryCode & "/"""
if you want the map to open in its own window, you can use Application.FollowHyperlink sURL where sURL is the string for the URL. Note that it must be a valid address! If anything is wrong or not found, you won't even get a map that is close.
I also use a different form for the URL:
Code:
Dim vURL As Variant _
, sURL As String
vURL = Null
With Me.Street
If Not IsNull(.Value) Then
vURL = (vURL + " ") & .Value
End If
End With
With Me.suburb
If Not IsNull(.Value) Then
vURL = (vURL + " ") & .Value
End If
End With
With Me.St 'State
If Not IsNull(.Value) Then
vURL = (vURL + " ") & .Value
End If
End With
With Me.PostCode
If Not IsNull(.Value) Then
vURL = (vURL + " ") & .Value
End If
End With
sURL = "https://maps.google.com/maps?q=" & vURL
Application.FollowHyperlink sURL