Anthony Daleo
New member
- Local time
- Today, 05:18
- Joined
- Sep 26, 2010
- Messages
- 2
I have an access 2007 database with a command button (cmdYahoo) on a form. It takes addresses from two text boxes and opens a yahoo map with directions. It works fine.
Here’s the code –
Private Sub cmdYahoo_Click()
Const URL_1 As String = _
"http://maps.yahoo.com/dd_result.php?q1=@ADDR@&q2=@DEST@"
Dim addr As String
Dim url As String
addr = TxStreetZip
addr = Replace$(addr, " ", "+")
addr = Replace$(addr, ",", "%2c")
dest = TxDestAdDestZip
dest = Replace$(dest, " ", "+")
dest = Replace$(dest, ",", "%2c")
url = Replace$(URL_1, "@ADDR@", addr)
url = Replace$(url, "@DEST@", dest)
ShellExecute ByVal 0&, "open", url, _
vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub
Now I am trying to do the same for Bing Maps, using the same code but different URL. The code seems to be working but I can’t get the URL right for directions. I can do it for one address (where=) "http://www.bing.com/maps/?v=2&where1=@ADDR@".
I tried "http://www.bing.com/maps/explore/?rtp=@ADDR@~@DEST@" but does not work.
Does anyone know the right URL?
Here’s the code –
Private Sub cmdYahoo_Click()
Const URL_1 As String = _
"http://maps.yahoo.com/dd_result.php?q1=@ADDR@&q2=@DEST@"
Dim addr As String
Dim url As String
addr = TxStreetZip
addr = Replace$(addr, " ", "+")
addr = Replace$(addr, ",", "%2c")
dest = TxDestAdDestZip
dest = Replace$(dest, " ", "+")
dest = Replace$(dest, ",", "%2c")
url = Replace$(URL_1, "@ADDR@", addr)
url = Replace$(url, "@DEST@", dest)
ShellExecute ByVal 0&, "open", url, _
vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub
Now I am trying to do the same for Bing Maps, using the same code but different URL. The code seems to be working but I can’t get the URL right for directions. I can do it for one address (where=) "http://www.bing.com/maps/?v=2&where1=@ADDR@".
I tried "http://www.bing.com/maps/explore/?rtp=@ADDR@~@DEST@" but does not work.
Does anyone know the right URL?