Hi, I have googled & posted no success as yet. Can anyone help?
I have been wrestling with a problem for days. The solution is probably simple but i am not that experienced with html.
I have a vb
program which sends info to a web page and as that page fills up a button is 'pressed' and the page is submitted, cleared and reloaded again.
To login to the site the code is as follows
oIE.Document.Forms("Login").All("district").Value = "district"
oIE.Document.Forms("Login").All("password").Value = password"
then I navigate thru several pages via code to get where I need to go
then the code I use is basically this (with non essential info cut out)
N1 = "order.code"
N2 = "order.quantity"
While Not .EOF
For x = 0 To 9
If Not .EOF Then
oIE.Document.Forms(0).All(N1 & x).Value = ![Product No]
oIE.Document.Forms(0).All(N2 & x).Value = !Qty
If Err = 3021 Then Exit For
While oIE.Busy: Wend
This works fine
So as you can see i am able to put info into forms where required. Now my problem. I have written new software that basically does the same thing but at a different site.
The login works fine but when the next page appears i am unable to enter any info into either of the 2 fields that are available
if i use the code
oIE.Document.Forms(0).All("Code").Value="1234" I get the error message
'Object variable or with block variable not set"
This is prolly because the forms(0) does not exist i think, although the form is there. I think i may need to access the document?
The html code is different for the input on this page also
On the first page the code reads
<input name="Password" type="password" id="Password" style="width:55px;" />
On the second page the code is;
<input id="SecurityCode" tabindex="1" name="SecurityCode" type="TEXT" value="" size="16" maxlength="6" />
so i do not know if there is a different way to pass a value to the "Input ID" field as opposed to the INPUT NAME field.
ANY help would be greatly appreciated as would some direction as to find out more about navigating or manipulating web pages from within VB
. (events properties methods etc)
Many thanks in advance
I have also noticed that the form name is missing and this is following the head
<link rel="stylesheet" type="text/css" HREF="/CMSIncludes/css/csall.css" title="def"/>
<body onload="document.frmSingleShare.SecurityCode.focus ();">
is it possible that this is a child window of sorts and that is why i cannot use the forms(0) methods