If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
open Map Quest from Form
I would like to open Map Quest from my records Form and have the Postal Code
automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#2
|
|||
|
|||
open Map Quest from Form
First, you need to download the code at this site:
http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#3
|
|||
|
|||
open Map Quest from Form
I thank you for the detailed response.
Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#4
|
|||
|
|||
open Map Quest from Form
You still have to contstruct the URL so it will pull up the map you want. If
you can do that, you may try the FollowHyperlink method, but if you don't know VBA, I don't think you will be able to do it. -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I thank you for the detailed response. Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#5
|
|||
|
|||
open Map Quest from Form
You're right, I don't think I would be able to do it.
Thanks again for your advice Bill D. "Klatuu" wrote: You still have to contstruct the URL so it will pull up the map you want. If you can do that, you may try the FollowHyperlink method, but if you don't know VBA, I don't think you will be able to do it. -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I thank you for the detailed response. Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#6
|
|||
|
|||
open Map Quest from Form
The URL is simple:
http://www.mapquest.com/maps/32708/ is mine so do it as a string in code, use a command button named cmdHyperlink with code like the following (txtZipCode being the name of the textbox containing the ZipCode field.): Private Sub cmdHyperlink_Click() Dim strPath As String If Not IsNull(Me.txtZipCode) Then strPath = "http://www.mapquest.com/maps/" & Me.txtZipCode & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BillD" wrote in message ... You're right, I don't think I would be able to do it. Thanks again for your advice Bill D. "Klatuu" wrote: You still have to contstruct the URL so it will pull up the map you want. If you can do that, you may try the FollowHyperlink method, but if you don't know VBA, I don't think you will be able to do it. -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I thank you for the detailed response. Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#7
|
|||
|
|||
open Map Quest from Form
Arvin:
Your directions were fantastic. I thought after responding to Dave H., that I would not be able to do this feature without programming help. I setup a command button on the form, copied your code into a double-click event procedure. Changed "txtZipCode" to "Postal_Code" in 2 places. Double-clicked on the Command Buttom and there was Map Quest with an area map showing a red star where the postal code was located. WOW! For your info - I only had to zoom-in once to have the street names show. Thanks soooo.... much. Bill D. Here is the final code I used. Private Sub cmdHyperlink_DblClick(Cancel As Integer) Dim strPath As String If Not IsNull(Me.Postal_Code) Then strPath = "http://www.mapquest.com/maps/" & Me.Postal_Code & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub "Arvin Meyer [MVP]" wrote: The URL is simple: http://www.mapquest.com/maps/32708/ is mine so do it as a string in code, use a command button named cmdHyperlink with code like the following (txtZipCode being the name of the textbox containing the ZipCode field.): Private Sub cmdHyperlink_Click() Dim strPath As String If Not IsNull(Me.txtZipCode) Then strPath = "http://www.mapquest.com/maps/" & Me.txtZipCode & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BillD" wrote in message ... You're right, I don't think I would be able to do it. Thanks again for your advice Bill D. "Klatuu" wrote: You still have to contstruct the URL so it will pull up the map you want. If you can do that, you may try the FollowHyperlink method, but if you don't know VBA, I don't think you will be able to do it. -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I thank you for the detailed response. Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#8
|
|||
|
|||
open Map Quest from Form
I'd already programmed something similar using MapPoint, so it wasn't much
of a stretch (actually it was easier) to use MapQuest. I might point out, that the code relies on the way MapQuest sets their webpages. Any change in their code may break ours. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BillD" wrote in message ... Arvin: Your directions were fantastic. I thought after responding to Dave H., that I would not be able to do this feature without programming help. I setup a command button on the form, copied your code into a double-click event procedure. Changed "txtZipCode" to "Postal_Code" in 2 places. Double-clicked on the Command Buttom and there was Map Quest with an area map showing a red star where the postal code was located. WOW! For your info - I only had to zoom-in once to have the street names show. Thanks soooo.... much. Bill D. Here is the final code I used. Private Sub cmdHyperlink_DblClick(Cancel As Integer) Dim strPath As String If Not IsNull(Me.Postal_Code) Then strPath = "http://www.mapquest.com/maps/" & Me.Postal_Code & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub "Arvin Meyer [MVP]" wrote: The URL is simple: http://www.mapquest.com/maps/32708/ is mine so do it as a string in code, use a command button named cmdHyperlink with code like the following (txtZipCode being the name of the textbox containing the ZipCode field.): Private Sub cmdHyperlink_Click() Dim strPath As String If Not IsNull(Me.txtZipCode) Then strPath = "http://www.mapquest.com/maps/" & Me.txtZipCode & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BillD" wrote in message ... You're right, I don't think I would be able to do it. Thanks again for your advice Bill D. "Klatuu" wrote: You still have to contstruct the URL so it will pull up the map you want. If you can do that, you may try the FollowHyperlink method, but if you don't know VBA, I don't think you will be able to do it. -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I thank you for the detailed response. Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#9
|
|||
|
|||
open Map Quest from Form
I found this thread and thanks to your help I have just added a link to Map
Quest on my Client Form. It is working fine on the first try but when I move to another client it opens the original map again. How do I make it refresh so each time I change clients it references the new postal code? -- Anne "Arvin Meyer [MVP]" wrote: I'd already programmed something similar using MapPoint, so it wasn't much of a stretch (actually it was easier) to use MapQuest. I might point out, that the code relies on the way MapQuest sets their webpages. Any change in their code may break ours. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BillD" wrote in message ... Arvin: Your directions were fantastic. I thought after responding to Dave H., that I would not be able to do this feature without programming help. I setup a command button on the form, copied your code into a double-click event procedure. Changed "txtZipCode" to "Postal_Code" in 2 places. Double-clicked on the Command Buttom and there was Map Quest with an area map showing a red star where the postal code was located. WOW! For your info - I only had to zoom-in once to have the street names show. Thanks soooo.... much. Bill D. Here is the final code I used. Private Sub cmdHyperlink_DblClick(Cancel As Integer) Dim strPath As String If Not IsNull(Me.Postal_Code) Then strPath = "http://www.mapquest.com/maps/" & Me.Postal_Code & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub "Arvin Meyer [MVP]" wrote: The URL is simple: http://www.mapquest.com/maps/32708/ is mine so do it as a string in code, use a command button named cmdHyperlink with code like the following (txtZipCode being the name of the textbox containing the ZipCode field.): Private Sub cmdHyperlink_Click() Dim strPath As String If Not IsNull(Me.txtZipCode) Then strPath = "http://www.mapquest.com/maps/" & Me.txtZipCode & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BillD" wrote in message ... You're right, I don't think I would be able to do it. Thanks again for your advice Bill D. "Klatuu" wrote: You still have to contstruct the URL so it will pull up the map you want. If you can do that, you may try the FollowHyperlink method, but if you don't know VBA, I don't think you will be able to do it. -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I thank you for the detailed response. Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
#10
|
|||
|
|||
open Map Quest from Form
Arvin:
Mapquest must have changed their code. My Mapquest button on the form does not work anymore. The reason is that in Canadian Postal Codes there is a space (ie. E3A 3N7). My data is stored this way. Mapquest used to accept this format but not anymore. How do I delete the space in the hyperlink created from the event on click (button on Form). Your help would be greatly appreciated. Here is my code. Private Sub cmdHyperlink_Click() Dim strPath As String If Not IsNull(Me.Postal_Code) Then strPath = "http://www.mapquest.com/maps/" & Me.Postal_Code & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub "Arvin Meyer [MVP]" wrote: The URL is simple: http://www.mapquest.com/maps/32708/ is mine so do it as a string in code, use a command button named cmdHyperlink with code like the following (txtZipCode being the name of the textbox containing the ZipCode field.): Private Sub cmdHyperlink_Click() Dim strPath As String If Not IsNull(Me.txtZipCode) Then strPath = "http://www.mapquest.com/maps/" & Me.txtZipCode & "/" Me.cmdHyperlink.HyperlinkAddress = strPath End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BillD" wrote in message ... You're right, I don't think I would be able to do it. Thanks again for your advice Bill D. "Klatuu" wrote: You still have to contstruct the URL so it will pull up the map you want. If you can do that, you may try the FollowHyperlink method, but if you don't know VBA, I don't think you will be able to do it. -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I thank you for the detailed response. Unfortunately, I am not a programmer. I don't think I could change the code you sent to accomplish the task. Is there an easier way to accomplish opening a Map Quest area map from a field on a form called "Postal Code". Thanks again, Bill D. "Klatuu" wrote: First, you need to download the code at this site: http://www.mvps.org/access/api/api0018.htm The normal FollowHyperlink will thow up a security screen that is annoying, but this does not. Then you need to experiment to determine how the URL should be styled to return the map you need. This will probably take a bit of tinkering. Then you can use the following as an example. In this code, I open Test Director with a user name and logon id and direct it to a specific task: Private Sub cmdTestDirector_Click() Const conHyperLink As String = "testdirector:bootlyboos.corp.wingy.com:8080/" & _ "qcbin,DEFAULT,BingBanDevelopment,NameHere,Passwor dHere;2:TaskNumberHere" Dim strPwd As String Dim strUser As String Dim strhyperlink As String strUser = GetUserID strPwd = Nz(DLookup("[TestDirectorPassword]", "dbo_employee", "[EmployeeLogin] = """ & _ strUser & """"), vbNullString) If strPwd = vbNullString Then MsgBox strUser & " Not Found in the Employee Table" & vbNewLine & _ "Please contact an administrator", vbExclamation, "Stars" Else strhyperlink = Replace(conHyperLink, "NameHere", strUser) strPwd = EncryptCode(1, strPwd) strPwd = Replace(strPwd, "None", vbNullString) strhyperlink = Replace(strhyperlink, "PasswordHere", strPwd) strhyperlink = Replace(strhyperlink, "TaskNumberHere", Me.txtTaskNumber) Call fHandleFile(strhyperlink, WIN_NORMAL) End If End Sub -- Dave Hargis, Microsoft Access MVP "BillD" wrote: I would like to open Map Quest from my records Form and have the Postal Code automatically inserted in Map Quest so I can then click on street view and have the map show the location with surrounding streets. Then I could print off the Map. I would be using this to show where people in my database live. I would only need addresses for New Brunswick Canada. Any help greatly appreciated. Bill D. |
|
Thread Tools | |
Display Modes | |
|
|