google search link

Losartan

Registered User.
Local time
Today, 11:43
Joined
Jul 21, 2005
Messages
39
hello,

I have a database that I would like to have a google search from.

I would like to have an unbound text box named "searchitem"

the user would type their search topic in the box and press a command button. This would search google and pull up the matches in their web browser.

How could I do this?

Thanks,
Jason
 
This is a pure common sense, but try this.

Code:
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Public Sub OpenURL(ByVal sURL As String)
    ShellExecute hwnd, "open", sURL, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub

Private Sub cmdSearchGoogle_Click()
    OpenURL "http://www.google.com/search?hl=en&q=" & replace(me.txtSearchTerm & "", " ", "+")
End Sub
 

Users who are viewing this thread

Back
Top Bottom