Pass value from Form to Google

detrie

Registered User.
Local time
Today, 07:34
Joined
Feb 9, 2006
Messages
113
Hi All

I'm am trying to push data from a control on my form to run a search on Google.com. If i get it to work with Google.com I hope to also use Hoovers.com.

My form has a control txtSearch and a cmdGo but that's it.

I could use a jumping off point

Thanks
Detrie
 
I use this:

PHP:
strSearch = Me.searchfield
Application.FollowHyperlink "http://www.google.com/search?q=" & strSearch
 
Well, if you run a search in google, and look at what google puts in the url you can get some ideas. If you drop some of the finer points at the end of the url you might get something like this, which is the result of a search using the string 'search tips'...
Code:
http://www.google.com/search?q=search+tips
So get your search terms. Replace the spaces with "+" signs, and then construct a url like...
Code:
"http://www.google.com/search?q=" & sYourSearchTerms
The I'd run an access help search for HyperlinkAddress properties FollowHyperlink methods, and put the whole thing together after a button click event or something.
 
I've just made a small and easy improvement to this little code. I'm putting it here in case anyone else needs it in the future.

This allows two or more words in the search terms:
PHP:
    If (Not IsNull(Controlname)) Then
        strSearch = Replace(Me.Controlname, " ", "+")
        Application.FollowHyperlink "http://www.google.com/search?q=" & strSearch
    Else
        MsgBox ("Control is empty..")
    End If
 

Users who are viewing this thread

Back
Top Bottom