FollowHyperlink has Question Mark in front

A

AJ

I'm trying to take information and open a browser to Google Maps. I got
it working almost perfectly fine, except for an error the screws things
up every now and then.

It outputs this link:

http://www.google.com/search?source...9,GGGL:en&q=?Texas+Tech+University+Lubbock+TX

Notice the "%3"

This is the code I'm using:

Private Sub Search_Click()
Dim strLinkPath As String
Dim strExtra As String

strLinkPath = "http://maps.google.com/maps?f=q&hl=en&q="
strExtra = Replace(Me.UniversityName, " ", "%20") & "+" &
Replace(Me.City, " ", "%20") & "+" & Me.State & "+"
Application.FollowHyperlink Address:=strLinkPath,
extrainfo:=strExtra, NewWindow:=True
End Sub

Any ideas are greatly appreciated!
 
M

moon

Hi Andrew,

Things changed a little, I think it'll work this way:

Private Sub Search_Click()
Dim strLinkPath As String

strLinkPath = "http://maps.google.com/maps?f=q&hl=en&q=" & _
Replace(Me.UniversityName, " ", "%20") & _
"+" & Replace(Me.City, " ", "%20") & _
"+" & Me.State
Application.FollowHyperlink Address:=strLinkPath, NewWindow:=True

End Sub
 

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

Similar Threads


Top