PDA

View Full Version : Solved: auto-fill webpage search form



av8tordude
05-05-2010, 06:43 AM
I have a userform that a user completes and if the airport is not listed, the user clicks a button to open the webpage seach engine. After the user enters the airport name on the webpage he must click the submit button. I would like to eliminate this process and have the information already displayed when the webpage opens.

The code I use to open to the webpage...


Call ShellExecute(0&, "OPEN", "http://www.acukwik.com/Default.aspx", _vbNullString, vbNullString, 3)

What I notice in the link below after I enter the name of the airport on the webpage, the only changes is the last word (RDU), which is the airport name

http://www.acukwik.com/AirportInfo/KRDU (http://www.acukwik.com/AirportInfo/KRDU)

Can some assist me in editing the code that will automatically display the webpage of the airport entered.

Thank you kindly

Crocus Crow
05-07-2010, 08:47 AM
Maybe like this:

Private 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

Private Const SW_SHOWNORMAL = 1

Sub X()
Dim airport As String
airport = "KRDU"
Call ShellExecute(0&, "OPEN", "h ttp://w ww.acukwik.com/AirportInfo/" & airport, vbNullString, vbNullString, SW_SHOWNORMAL)
End Sub

(Remove the spaces in the URL)

av8tordude
05-07-2010, 09:27 AM
Thank you Crocus Crow. Works Great!!!!:beerchug:

mdmackillop
05-07-2010, 10:33 AM
Hi Both,
When you post code, please use VBA tags or the green VBA button to format it (see post 2). Code tags don't do that here.
Regards
MD