Hi David,
If you do a google map search for a place and it generates a valid
location,
you can get a link to it in the browser address. For example: Riverside
California 92504 would generate the following link :
http://maps.google.com/maps?f=q&hl=en&q=Riverside+California+92504
So you could use your address record field data to construct a URL like
this
"
http://maps.google.com/maps?f=q&hl=en&q=" & [street] & "+" & [city] & "+"
&
[state] & "+" & [zip]
If you want the results displayed on the address form you'll have to add
the
Microsoft Web Browser ActiveX control to it. You can use the forms
OnCurrent
event to display the results in the Web Browser control:
Private Sub Form_Current()
On Error GoTo Err_Form_Current
Dim strURL As String
strURL = "
http://maps.google.com" ' or other default web page.
If Not NewRecord Then
With Me
'strURL = "
http://maps.google.com/maps?f=q&hl=en&q=" &
![street]
& "+" & ![city] & "+" & ![State] & "+" & ![zip]
End With
End If
ctlWebBrowser.Navigate strURL
Exit_Form_Current:
Exit Sub
Err_Form_Current:
MsgBox Name & "_Current Error: " & Err.Number & ": " & Err.Description
Resume Exit_Form_Current
End Sub
If the Web Browser Control doesn't appear in youlist of ActiveX controls
you'll have to install Microsoft Internet Controls Library SHDocVw (it'll
then appear in C:\WINDOWS\System32\shdocvw.dll or similar).
Regards
Ian
David said:
Right now I have a form with addresses and want to be able to get a google
map from it. How do I go about doing so?
Right now I have 4 fields for the address: street, city, state, zip