G
Guest
Hello,
I'm trying to create a button in access 2007 that will
a) open maps.google.com (this part i can get no problem)
b) automatically enter the address information from the record.
I think it should be something like:
Private Sub Strip_Map_Click()
On Error GoTo Err_Strip_Map_Click
Dim stAddress As String
Dim stCity As String
Dim stState As String
Dim stZip As String
Dim stFullAddress As String
stAddress = [ADDRESS]
stCity = [CITY]
stState = [STATE]
stZip = [ZIP]
Access.FollowHyperlink "http://www.mapquest.com/maps/map.adp?" &
"formtype=address&searchtype=address" & URLEncode("&address=" &
Trim(Nz([stAddress], "") & "&city=" & Trim(Nz([stCity], "")) & "&state=" &
Trim(Nz([stState], "")) & "&zip=" & Trim(Nz([stZip], ""))))
Debug.Print "http://www.mapquest.com/maps/map.adp?" &
"formtype=address&searchtype=address" & URLEncode("&address=" &
Trim(Nz([stAddress], "") & "&city=" & Trim(Nz([stCity], "")) & "&state=" &
Trim(Nz([stState], "")) & "&zip=" & Trim(Nz([stZip], ""))))
Exit_Strip_Map_Click:
Exit Sub
Err_Strip_Map_Click:
MsgBox Err.Description
Resume Exit_Strip_Map_Click
End Sub
But obviously it isn't working properly. Anyone have any ideas?
Thank you!
I'm trying to create a button in access 2007 that will
a) open maps.google.com (this part i can get no problem)
b) automatically enter the address information from the record.
I think it should be something like:
Private Sub Strip_Map_Click()
On Error GoTo Err_Strip_Map_Click
Dim stAddress As String
Dim stCity As String
Dim stState As String
Dim stZip As String
Dim stFullAddress As String
stAddress = [ADDRESS]
stCity = [CITY]
stState = [STATE]
stZip = [ZIP]
Access.FollowHyperlink "http://www.mapquest.com/maps/map.adp?" &
"formtype=address&searchtype=address" & URLEncode("&address=" &
Trim(Nz([stAddress], "") & "&city=" & Trim(Nz([stCity], "")) & "&state=" &
Trim(Nz([stState], "")) & "&zip=" & Trim(Nz([stZip], ""))))
Debug.Print "http://www.mapquest.com/maps/map.adp?" &
"formtype=address&searchtype=address" & URLEncode("&address=" &
Trim(Nz([stAddress], "") & "&city=" & Trim(Nz([stCity], "")) & "&state=" &
Trim(Nz([stState], "")) & "&zip=" & Trim(Nz([stZip], ""))))
Exit_Strip_Map_Click:
Exit Sub
Err_Strip_Map_Click:
MsgBox Err.Description
Resume Exit_Strip_Map_Click
End Sub
But obviously it isn't working properly. Anyone have any ideas?
Thank you!