View Full Version : Pulling specific data from userform entities to an array
Zephid15
08-10-2007, 06:41 AM
How would I go about pulling data from different textboxes depending on what checkboxes are checked?
Example:
If the user selects checkbox 1 then I want data from textboxes 1, 2, and 3 to be in the array. But if checkbox 3 is selected then I want data from 7, 8, and 9. While, if checkbox 1 and 2 are selected I want 1-6.
fumei
08-10-2007, 08:19 AM
Work out the logic, and write it. What would be the best way depends on how many controls you are talking about.
So far you mention
IF checkbox1 = true then Data = Textbox 1, 2, 3
IF checkbox3 = true then Data = Textbox 7, 8, 9
IF checkbox1 & 2 = true then Data = Textbox 1 - 6
OK, but what if checkbox 1 and 3? 3 and 2?
However, it does not really matter, as you have to simply write out the logic anyway.
Select Case checkbox1
Case True
If checkbox2 = false then
array = Textbox 1, 2, 3
Else
array = textbox 1 - 6
End If
case False
' you don't say, but perhaps you should
End Select
etc. etc.
Zephid15
08-10-2007, 09:42 AM
sorry i was unclear.
IF checkbox1 = true then array = 1, 2, 3
IF checkbox2 = true then array = 4, 5, 6
IF checkbox3 = true then array = 7, 8, 9
IF checkbox1 & 2 = true then The array =
1, 2, 3,
4, 5, 6
IF checkbox1 & 3 = true then The array =
1, 2, 3,
7, 8, 9
IF checkbox1, 2 & 3 = true then The array =
1, 2, 3,
4, 5, 6,
7, 8, 9
ext...
so each check box has 3 corisponding textboxes that i want in the array.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.