Connecting Tech Pros Worldwide Forums | Help | Site Map

Writing in a field on a webpage

Site Addict
 
Join Date: Feb 2007
Posts: 553
#1: Dec 21 '08
Hi

I am trying 2 different methods to accomplish my requirement - With OLE and without OLE

The requirement is to simply open a webpage with Internet browser - Done this one

Now type in something in the field on the page.

I have used SendKeys() but it doesn't seems to write anything in the field.

Note: When the webpage opens, the cursor is already in the field.

Could any one help me how could i do this please

Awaiting

Thanks
qi

GazMathias's Avatar
Expert
 
Join Date: Oct 2008
Location: Bristol, United Kingdom
Posts: 144
#2: Dec 21 '08

re: Writing in a field on a webpage


Hi,

A webpage with a form would pass its information through to either itself for processing, or another page designed specifically for precessing the data passed.

The page receiving the data would get the values from either the querystring or from POST (depending on the form's setup).

In the first scenario, say we have a simple page called form.php with one field that asks for your name, the field on that page could be called txtname. When you press the submit button, the page would send its data to another page called processing.php. The form would redirect the browser to this URL:

Expand|Select|Wrap|Line Numbers
  1. http://www.somesite.com/processing.php?txtname=Gaz
What you can do in Access is simply avoid the first page altogether and call the processing page directly:

Expand|Select|Wrap|Line Numbers
  1. Dim IE
  2. Dim URL As String
  3.  
  4. Set IE = CreateObject("InternetExplorer.Application")
  5.  
  6. URL = "http://somesite.com/processing.php?txtname=" & Me.txtname ' Where Me.txtname is a field on the Access form calling this code.
  7.  
  8. IE.Navigate (URL)
  9. IE.Visible = True
  10.  
If the form is sending its data using POST, then we would have to populate the form data like you want, but you would have to make changes to that page, namely some Java Script to receive values from the querystring, fill in the form data and then (maybe) submit the page too.

Obviously, that is beyond the scope of the Access forum. Once you have that page working correctly, the Access principle remains the same.

Gaz
Reply