Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 08-09-2004, 08:01 PM   #1
Member (8 bit)
 
oleblue73's Avatar
 
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
oleblue73 is offline   Reply With Quote
Old 08-10-2004, 11:18 AM   #2
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
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...}
doctorgonzo is offline   Reply With Quote
Old 08-11-2004, 09:37 AM   #3
Member (8 bit)
 
oleblue73's Avatar
 
Join Date: Feb 2003
Location: Deltona, FL
Posts: 144
Thanks! It worked!
oleblue73 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:51 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2