command button on form

G

Guest

I have a form showing name and address, would like to add
a command button for user to click on to view a map from
map point, having the comand pick up the address, city etc
from the form and opening web page and showing the map,
when the command button is pressed. Any ideas?
 
W

Wayne Morgan

I haven't tried it with Map Point and I don't know Map Point's command line
structure. However, I've used the following with Expedia to get a web map.

Private Sub lblMap_MouseMove(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim hlk As Hyperlink, msg As String, strHLAddress As String
Dim strAddress As String, strCity As String, strState As String, strZip As
String
Dim strOldString As String, strNewString As String

Set hlk = Me!lblMap.Hyperlink

strOldString = " "
strNewString = "+"
strAddress = Replace(Nz(txtStreetAddress1, ""), strOldString, strNewString)
strCity = Replace(Nz(cmbCity, ""), strOldString, strNewString)
strState = Replace(Nz(txtState, ""), strOldString, strNewString)
strZip = Left(Nz(txtZipCode, ""), 5)

strHLAddress = "http://www.expedia.com/pub/agent.dll?qscr=mcst&strt1=" &
strAddress & _
"&city1=" & strCity & "&stnm1=" & strState & _
"&zipc1=" & strZip & "&cnty1=4"
hlk.Address = strHLAddress
End Sub

This changes the hyperlink in a label when the mouse moves over the label so
that when it is clicked it will send the address information to Expedia.
 

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