Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Complex checkbox validation question(s)

Posted on 2009-02-20
Medium Priority
Last Modified: 2013-11-23
I have a request to create multiple "sections" with multiple checkboxes underneath and they have requested:

"...If EITHER one of SECTION TITLE A is NOT checked off (i.e., has to check ALL to proceed) or if either of SECTION TITLE B IS checked-off, then a pop-up window should come up saying:  yaddayaddayadda.  When the user clicks OK, they are re-directed to another page.

...or if ALL of SECTION TITLE A are checked off and NONE of SECTION TITLE B are checked off, then force to save and load a specific page.

...and if ALL of SECTION TITLE A are checked off, NONE of SECTION TITLE B are checked off, and ANY warnings are checked off, a popup should come up: Warning!"

Is this actually doable? The person requesting isn't sure but would like it if possible. I have already created all of the checkboxes and wording next to them, but am confused as to how I'd verify check/unchecked in multiple sections, or how to load a specific page based on results. (not a real programmer, just trying to help out until person returns...sorry for so many questions!)

Section Title A
q	option 1
q	option 2 
q	option 3
q	option 4
Section Title B
q	option 1
q	option 2
q	option 3
q	option 4
q	option 5
q	option 1
q	option 2

Open in new window

Question by:Bulldog7
  • 2
LVL 15

Accepted Solution

aibusinesssolutions earned 2000 total points
ID: 23697639
Do you need the errors and warnings to pop up After a button is clicked?

If so that's pretty simple, just a basic If/Then.

Protected Sub Button1_Click()

   Dim GroupAChecked As Boolean
   Dim GroupBChecked As Boolean
   Dim GroupWarnings As Boolean

   If chkAOption1.Checked And chkAOption2.Checked And chkAOption3.Checked Then
        GroupAChecked = True
   End If

   If chkBOption1.Checked Or chkBOption2.Checked Or chkBOption3.Checked Then
        GroupBChecked = True    
   End If

  If chkWarning1.Checked Or chkWarning2.Checked Then
    GroupWarnings = True
  End If

   If Not GroupAChecked Then
       'do some stuff
   End If

   If GroupBChecked Then
       'do some other stuff
   End If

   If GroupWarnings Then
       'do other other stuff
   End If

End Sub

Author Comment

ID: 23711031
aibusinesssolutions, I think just the warning has to come up and then either the page reloads or is directed to another page (of which I'm not really sure how THAT works either. I apologize for all of the questions, trying to help out a group, but have limited grasp beyond edits and adds...not to mention this somehow links back to SQL.

When you write "do some stuff/do some other stuff" would that imply the loading or redirecting of pages?

Author Comment

ID: 23711050
...also, what would be the easiest way to create "groups" of the 3 sections I have listed, so that they can be referenced as such in your code?

Thank you for all of your advice btw...

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question