Searching the internet

  • Thread starter Thread starter Maracay
  • Start date Start date
M

Maracay

Hi guys,

I need to create a command button, to search in google the information I
have in a text box, example: txtSearch: African elephant, I need a command
button to search African elephant using google.com, how can I do that.

Thanks
 
Maracay,

The following code assumes that your text box where the user will type in
the value that is to be searched for is named: "txtSearchVal". You will need
to change this name to the actual name of your text box.

Then in the OnClick event of your command button past the following code:

Dim strSearchVal As String
If Not IsNull(Me.txtSearchVal) Then
strSearchVal = Me.txtSearchVal
Application.FollowHyperlink "http://www.google.com/search?" _
& "q=" & strSearchVal & ""
End If
End Sub

HTH
Mr. B
askdoctoraccess dot com
 
Back
Top