By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,659 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,659 IT Pros & Developers. It's quick & easy.

Writing in a field on a webpage

100+
P: 553
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
Dec 21 '08 #1
Share this Question
Share on Google+
1 Reply


GazMathias
Expert 100+
P: 189
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
Dec 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.