Results 1 to 2 of 2

Thread: html objects question

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    I'm hoping that someone smarter then I might be able to lend me a hand. I am writing a program that outputs an .hta application and a vbs script. The outputed file is used to make changes to an Access Database, and the vbscript is used to actually make those changes. Well, here is my problem.

    Lets say in the .hta program, the form name is "form1", and the textboxes to be changed are "T1-50"

    Now I need to perform an action on all of those T1-50 textboxes when the submit button is clicked. However, I can not figure out how to set this into a loop. For example, I have tried:

    Code:
    For x=0 to 50 
       If form1.T & x & .value="Update" then
             do something
       Else
             do somethingelse
       end if
    Next
    The error that I am getting is that the object or method does not exist, which makes sense. However, in regular vb, I can write this statement and it will work, but not in vbs. Right now, the solution to my problem is to just write out each individual action, but this could make the .vbs file incredibly bulky (I am working with tens of thousands of records). I know that it can be done in Javascript, but I really don't want to do it, so if you can help, I would appreciate it.



  2. #2
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554

    Wink Arrays

    Instead of naming your textboxes Text1, Text2, Text3 etc...
    Use Arrays, so its Text1(0), Text1(1), Text1(2) etc...

    Then change youtr code to handle arrays instead of the string name

    Code:
    For x = 0 to 50 
       If Form1.Text1(x).Value = "Update" Then
             'do something here
    
       Else
             'do somethingelse here
    
       End If
    Next
    DocZaf
    {;->


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width