Results 1 to 2 of 2

Thread: Use Checkbox name in Array Loop

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45

    Post

    I'm trying to build a loop that automatically sets the values of a group of check boxes based on information in an Array. How can i generate the name of the current checkbox name in this loop, it's abit hard to explain but hopefully you can see what i'm trying to do from the code :


    GetSites 'Calls a function that gets all the values

    For i = 1 To 12
    Check&i.Value = Sites(i)
    Next i

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    How about using a control array instead, change all checkboxes to have the same name and set their indexes the order you want. Might be not as easy as delete all checkboxes and create one, name it check and copy and paste it 11 times
    Code:
    For i = 1 To 12 
       Check(i-1).Value = Sites(i) 
    Next i
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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