Thread: Check Boxes

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    2
    Rep Power
    0

    Check Boxes


    To whom it may concern:

    I have a group of Checkboxes on a form. I would like to find out how I can detect whether a checkbox has been selected or not within that grouping. For my purposes, I have to select one or more check boxes to continue with a process else display a message stating that I need to select on one or more checkboxes to continue, etc.

    Appreciate anyones help.

    Thanks.........
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,616
    Rep Power
    4247
    Assuming your checkboxes are named Checkbox1, Checkbox2 etc., the simplest way would be to do this:
    Code:
    if (not CheckBox1.Checked) and (not Checkbox2.Checked) and
       (not CheckBox3.Checked) and ... (not Checkbox8.Checked) then
        ShowMessage('Please check a box')
    else
        DoSomething;
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    2
    Rep Power
    0
    Hey, thanks for the reply! I'll give it go!!!

IMN logo majestic logo threadwatch logo seochat tools logo