469,336 Members | 5,746 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

Please help

i posted similar to vb forum but without success. Can anyone help here

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
End If
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.

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 ();">
<SCRIPT LANGUAGE="JavaScript1.2" SRC="/CMSIncludes/menu/HM_LoaderX.js" TYPE='text/javascript'></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="/CMSIncludes/menu/cfg/SHARES01.js" TYPE='text/javascript'></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="/CMSIncludes/menu/HM_LoaderXa.js" TYPE="text/javascript"></SCRIPT>

is it possible that this is a child window of sorts and that is why i cannot use the forms(0) methods

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 for any help offered
Sep 2 '06 #1
0 1135

Post your reply

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

Similar topics

7 posts views Thread by tyler_durden | last post: by
23 posts views Thread by Jason | last post: by
5 posts views Thread by tabani | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.