Searching the internet

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
 
M

Mr. B

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
 

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

Top