Results 1 to 4 of 4

Thread: Need help with a group panel and check boxes [Resolved]

  1. #1

    Thread Starter
    Addicted Member Porsche944's Avatar
    Join Date
    Apr 2005
    Location
    Ann Arbor
    Posts
    182

    Resolved Need help with a group panel and check boxes [Resolved]

    Hey,
    I have 7 check boxes inside a group panel. I need to make sure at least one of them is checked. How can I do this I can't wrap my mind around something like this.

    Here is some code that loop through all the checkboxes in the panel but for the life of me i can't figure out how to make sure at least one is checked.

    Code:
    for each cb as checkbox in gpOutput.Controls
    'some code to test to make sure at least one of the 7 check boxes is checked
    netxt
    Thank you masters
    Last edited by Porsche944; May 9th, 2005 at 08:32 PM.

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Need help with a group panel and check boxes

    I cranked this out pretty quick, with out testing, so check the syntax:
    VB Code:
    1. dim b as boolean
    2.  
    3. for each cb as checkbox in gpoutput.controls
    4.   if cb.checked = true then
    5.     b = true
    6.     exit for
    7.   end if
    8. Next
    9. if not b then
    10.   messagebox.show("Check a box")
    11.   exit sub
    12. end if

  3. #3

    Thread Starter
    Addicted Member Porsche944's Avatar
    Join Date
    Apr 2005
    Location
    Ann Arbor
    Posts
    182

    Cool Re: Need help with a group panel and check boxes

    testing this baby out...

  4. #4

    Thread Starter
    Addicted Member Porsche944's Avatar
    Join Date
    Apr 2005
    Location
    Ann Arbor
    Posts
    182

    Talking Re: Need help with a group panel and check boxes

    Worked like a charm!

    Is there anything you CAN'T do?

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