|
-
Aug 14th, 2002, 09:36 PM
#1
Thread Starter
Fanatic Member
URGENT- SOS-Help - Variables and Text boxes
I have 3 variables and 10 text boxes. I will try my best to explain this! LOL
I want an easy way to do this. If the value of Var1 = 2 then take the values of text box 1 and 2. If Var2 = 3 then take the value of text3, text4 and text5. If Var3 = 5 then take the value of Var6, Var7, Var8, Var9, Var10...
Variable 1 should take the values from the sequence of text boxes appearing in the value of the variable...
HELP HELP
-
Aug 15th, 2002, 03:06 AM
#2
-
Aug 15th, 2002, 11:41 AM
#3
Thread Starter
Fanatic Member
I am not getting me responses, so let me try and reword this to excatly what I am trying to do:
I have three soccer coaches identified by Var1, Var2 and Var3..
I have 40 players with names which are listed in the text boxes from text1 to text40...
I need to distribute the players under the coach according to the value appearing in the Var1, Var2 and Var3...
Example:
Var1 (Coach1) = 2 (needs two players) then take the value of the first two text boxes, Text1 and text2 and store the value into two seperate variables.
Var2 (coach2) is = 3 then take the value of the next three text boxes , text3 text4 and text5 and store it into seperate variables..
Var3 (coach3) needs 1 player.. then take the value of text6 and store it into a variable..
-
Aug 17th, 2002, 04:11 PM
#4
New Member
Instead of using Text1 to Text40, do something like this:
Add a new textbox.
Rename it txtPerson.
Change the index value to 0.
Then copy and paste that textbox.
Now you have txtPerson(0) to txtPerson(39)
Use 3 listboxs under 3 textboxs, each listbox/textbox combination can be a coach.
Name the textbox's txtCoach(0), txtCoach(1) and txtCoach(2)
For i = 0 To Int(txtCoach(0).Text) - 1
lstCoach(0).AddItem txtPerson(i)
Next i 'don't need i, but looks nice
For i = txtCoach(0).Text To (Int(txtCoach(0).Text) + Int(txtCoach(1).Text) - 1)
lstCoach(1).AddItem txtPerson(i)
Next i
For i = (Int(txtCoach(0).Text) + Int(txtCoach(1).Text)) To (Int(txtCoach(0).Text) + Int(txtCoach(1).Text) + Int(txtCoach(2).Text) - 1)
lstCoach(2).AddItem txtPerson(i)
Next i
May look a little confusing, but I'll try to explain (I did this in 5 minutes)
It starts after the last valued used, and continues to the next number. I subtract one (int(txtcoach(0).text)-1) because the very first value is 0, so going from 0 to 4 would use 5 textboxes.
I'm sure you're confused, but message back any questions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|