Re: Passing textbox data into String for URL



Daniel,

Thanks so much for the response. I understand how that works, but now
I've run into a problem I think with the hyperlink. The way the
address is displayed in the hyperlink is with a + between each word.
So 111 + Pheasant + Lane .. etc. My txtaddress only shows 111 Pheasant
Lane.

So the URL would read

http://maps.google.com/maps?q=111 Pheasant
Lane+txtcity+txtstate+txtzip. Any way to insert + into the spaces of
the address so that it comes out right? Or any way to display this url
into another textbox? I tried to make a textbox with =[myGoogleMapURL]
in it and I get a #Name.

My code:
Private Sub CmdGet_click()

Dim strAdd As String
Dim strCity As String
Dim strState As String
Dim strZip As String
Dim MyGoogleMapURL As String
Dim strHypPre As String 'Google prefix url
Dim strHypCri As String


strAdd = Me.txtaddress
strCity = Me.txtcity
strState = Me.txtstate
strZip = Me.txtzip


strHypPre = "http://maps.google.com/maps?q=";
strHypCri = strAdd & "+" & strCity & "+" & strState & "+" & strZip
MyGoogleMapURL = strHypPre & strHypCri
End Sub

This is on the patient subform of the tabbed record. And then on the
map tab, I have a button to pass this string to the webbrowser.

Private Sub cmdgotourl_Click()
Me.WebBrowser0.Navigate MyGoogleMapURL
End Sub

Again, thanks for your help!

.