Insert value from form into Internet search

  • Thread starter Thread starter jnrock
  • Start date Start date
J

jnrock

Guest
Hello all, I have problem that has been eluding me. I would like to set up a button on one of my forms that when clicked will take the value of a given field and do an internet search for that value using, say, Google. The value would be different on each form page.

I know how to get IE to open up, but am unsure of how to insert the search string automatically into the address bar and have it do its thing. It seems like it should be easy, but I can't figure it out.

Here's an example of a string: http://www.google.com/search?hl=en&q=access&btnG=Google+Search
Where access would be the field value searched for on a particular page.

Any help on this would be appreciated!
Thanks,
Justin
 
Update!

Just wanted to post an update as I figured it out. May help other folks new to this.

I wanted to be able to take two coordinates from a form and, when a button was clicked, search the MapQuest page that searches by Lat/Lon.

Below is the code I added to the button in the VB editor:

Private Sub MapIt_Click()
On Error GoTo Err_MapIt_Click

Dim stAppName As String

stAppName = "g:\Program Files\Internet Explorer\iexplore.exe http://www.mapquest.com/maps/map.adp?searchtype=address&formtype=latlong&latlongtype=decimal&latitude=" & [Latitude] & "&longitude=" & [Longitude]
Call Shell(stAppName, 1)

Exit_MapIt_Click:
Exit Sub

Err_MapIt_Click:
MsgBox Err.Description
Resume Exit_MapIt_Click

End Sub

I also used this code to search Google for keywords added to a "keyword" field. You would just insert the Google search string in place of the MapQuest one.

Hope this helps someone, thanks for the great forum. :)

Justin
 
Hiya - smae sort of problem but not with internet explorer

Hiya, i work for an architectural company.

Within our database we have a project sheet, which gives alll the details regarding each of our jobs, from clients names, address to survey dates and when drawings are completed.

Each job we undertake we give a unique project ID, which is generated by the database. once the job is created we make a folder on our server and place all our CAD drawings in there.

what i would like to be able to do, is click on a button on the projectsheet form, which then uses the value of the project ID in the ProjectID field, and then use windows explorer to open that folder with the same projectID. is this possible?? ive managed to get a button to open a windows explorer window to our main jobs folder, but not to open the specified ProjectID folder.

Im sorry im totally new to all this stuff. so any help would be appreciated

thanx

keith
 

Users who are viewing this thread

Back
Top Bottom