open Map Quest from Form

B

BillD

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.
 
K

Klatuu

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,PasswordHere;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
 
B

BillD

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 said:
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,PasswordHere;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 said:
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.
 
K

Klatuu

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 said:
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 said:
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,PasswordHere;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 said:
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.
 
B

BillD

You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

Klatuu said:
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 said:
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 said:
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,PasswordHere;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


:

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.
 
A

Arvin Meyer [MVP]

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 said:
You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

Klatuu said:
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 said:
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.

:

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,PasswordHere;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


:

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.
 
B

BillD

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 said:
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 said:
You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

Klatuu said:
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


:

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.

:

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,PasswordHere;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


:

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.
 
A

Arvin Meyer [MVP]

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 said:
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 said:
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 said:
You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

:

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


:

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.

:

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,PasswordHere;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


:

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.
 
A

Anne

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 said:
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 said:
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 said:
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

You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

:

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


:

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.

:

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,PasswordHere;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


:

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.
 
B

BillD

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 said:
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 said:
You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

Klatuu said:
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


:

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.

:

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,PasswordHere;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


:

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.
 
B

BillD

This post is so old I decided to use a new post under "MapQuest Button On Form"

BillD said:
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 said:
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 said:
You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

:

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


:

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.

:

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,PasswordHere;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


:

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.
 
M

MartyO

Awesome! This is exactly what I needed to do for my Leads database. I used
your code...it was so easy! And I changed it up a little bit to actuallyy
look for my customer's address, not just the zipcode. Here it is. Thanks so
much!
Private Sub cmdHyperlink_Click()
Dim strPath As String
Dim strMapIt As String
If Not IsNull(Me.Address) Then
strPath = "http://www.mapquest.com/maps?city=" & Me.City & "&state=" &
Me.State & "&address=" & Me.Address & "&zip=" & Me.Zip &
"&country=US&CID=lfmaplink/"
Me.cmdHyperlink.HyperlinkAddress = strPath
End If

End Sub

BillD said:
This post is so old I decided to use a new post under "MapQuest Button On Form"

BillD said:
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 said:
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

You're right, I don't think I would be able to do it.
Thanks again for your advice
Bill D.

:

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


:

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.

:

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,PasswordHere;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


:

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top