|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (8 bit)
Join Date: Feb 2003
Location: Deltona, FL
Posts: 144
|
Verifying Checkboxes in a control array in VB6
I'm trying to write code that verifies that a user has checked at least one checkbox in a control array of 8 checkboxes. I know I can do it with a very long if...then statement, but there must be a way to do it with looping statements. I just can't figure out how! I'm using VB6. Any help will be appreciated!
__________________
My Box: AMD Athlon 64 X2 5600+ | MSI K9N Neo-F V3 | 2GB Corsair XMS 2 DDR2 | Seagate 250GB HDD | 512 MB ATI Radeon X1900XT | Lite-on DVD R/RW drive | Codgen ATX case w/ Thermaltake 480W PS |
|
|
|
|
|
#2 |
|
Professional gadfly
|
There is probably a more elegant solution, but you could try this (contains unfortunate GOTO statement):
Code:
for x = 1 to numberBoxes
if Form.checkbox[x].value then goto Verified
next
MsgBox "Please select at least one option!"
Exit Sub
Verified:
{more code here...}
|
|
|
|
|
|
#3 |
|
Member (8 bit)
Join Date: Feb 2003
Location: Deltona, FL
Posts: 144
|
Thanks! It worked!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|