check boxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    #1

    check boxes

    how do you use a check box in a form, lets say you have a question (that needs to be answered) on a form and you have three check boxes and one is the right answer and two is wrong answer. if they pick one and its not the right answer. how would you make it so they couldn't change there answer. another words is if they pick the wrong answer the answer would stay checked and they couldn't check any other one to change there answer and be forced to go to the next question.
  • maxamis4
    Recognized Expert Contributor
    • Jan 2007
    • 295

    #2
    For these kinds of things what you do is use the command button to finialize their answer. Once the table has a value inside the field it is referencing with the text box you lock the control and set the enabled property to disabled.

    Comment

    • MSeda
      Recognized Expert New Member
      • Sep 2006
      • 159

      #3
      Firstly, you'll want to use an option group rather than just a regular check box. An option group is a frame that contain several controls(like checkboxes) that each have a unique value a user may select only on option in a frame at a time. The frame itself is what is bound to and passes the value to the table.
      That said if you want the user to be forced to move to the next question you use the afterupdate event of the frame to either close the form and open the next form or move the focus to the next question on the same form and lock the frame.

      Comment

      • lee123
        Contributor
        • Feb 2007
        • 556

        #4
        is there a code that goes behind the option box or the check boxes?

        Comment

        • lee123
          Contributor
          • Feb 2007
          • 556

          #5
          ok i figured it out but know i have in the footer of the form two txtboxes named correct and another one named incorrect whats the code for this ...i mean how do i use the count function for these two txtboxes to count the correct and the incorrect is there a way to put this in vba or in the txtbox itself

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32669

            #6
            You need to share with us which controls (with names) are on your form. From there we could put in a formula which will count your results.

            Comment

            • lee123
              Contributor
              • Feb 2007
              • 556

              #7
              On the form i have three checkboxes and a button:

              Names:

              Question 1

              1 - CheckA
              2 - CheckB
              3 - CheckC


              Question 2:

              1 - Cb1
              2 - Cb2
              3 - Cb3

              And a button

              Question 3


              1 - Checkbox1
              2 - Checkbox2
              3 - Checkbox3

              And a button

              And a button called:

              1 - CheckAnswerButt on

              In the footer of the form i have two text boxes:


              1 - Correct
              2 - Incorrect

              I want to be able to have the correct answers to be put in the "Correct" box and the "Incorrect" be put in the "Incorrectb ox"

              Thanks
              Lee123
              Last edited by NeoPa; Jun 12 '07, 06:21 PM. Reason: Please do not use all upper case.

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32669

                #8
                What do all the buttons do?
                How am I supposed to know which CheckBoxes (you should really be using Frames with RadioButtons by the way) represent a correct answer?

                Please make the effort to read your post before submitting it. It is much easier to deal with questions when they make proper sense.

                Comment

                • lee123
                  Contributor
                  • Feb 2007
                  • 556

                  #9
                  ok the user has a question that he has to answer, underneath the question there are three check boxes (answers), one is the correct answer and two are the wrong answer.
                  all the checkboxes have a msgbox that pops up and tells the user if it's "correct" or "incorrect" for example :

                  (question) what's 20 + 20 =

                  checkbox1(15) or checkbox2 (25) or checkbox3 (40)

                  the user would check (checkbox3(40) ) and click a button named 'answerbutton" to check his answer

                  in this case the correct answer is (40) a msgbox would popup and have "correct"
                  but if they didn't know that it was forty and they chose (25) a msgbox would appear and say: "incorrect! "

                  there is going to be several questions on a form like this


                  then in the footer of the form there are two textboxes one is a txtbox (correct) and the other is (incorrect) if there is a way to count how many times they get an answer "correct" or "incorrect" that would be cool but if there isn't then i'll have to try something else

                  thanks
                  lee123

                  Comment

                  • lee123
                    Contributor
                    • Feb 2007
                    • 556

                    #10
                    oh by the way the check boxes are single ones>

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32669

                      #11
                      OK. You really need to consider using Radio Buttons still as they make you job a lot easier.
                      You don't quite answer the questions but I'll see if I can express it generally for you anyway.
                      Assume that CheckA, CB2 & Checkbox3 are the correct answers. Your formula in the TextBox would be :
                      Code:
                      =IIf(CheckA,1,0)+IIf(CB2,1,0)+IIf(Checkbox3,1,0)
                      PS I'm afraid I don't know what you mean by Single ones in your previous post :(

                      Comment

                      • lee123
                        Contributor
                        • Feb 2007
                        • 556

                        #12
                        Thanks I'll try it when I said there are single checkboxes I meant that there not option grouped anyway I tried to answer your question as good as I could but im very busy here at work and I had only a few minutes to answer your question right sorry if I didn't make any sense


                        Thanks
                        Lee123

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32669

                          #13
                          I've got you Lee.
                          Please try not to post in all caps though. That just gives me MORE work to do.
                          Let me know how you get on anyway :)

                          Comment

                          • lee123
                            Contributor
                            • Feb 2007
                            • 556

                            #14
                            you know i tried the code you displayed and i put it in the afterupdate but nothing so then i tried to put it in the control property and nothing what am i doing wrong am i suppose to dim this or what?

                            lee 123

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32669

                              #15
                              In the Control Source of your two TextBoxes put :
                              1. Correct
                                Code:
                                =IIf(CheckA,1,0)+IIf(CB2,1,0)+IIf(Checkbox3,1,0)
                              2. Incorrect
                                Code:
                                =IIf(CheckA,0,1)+IIf(CB2,0,1)+IIf(Checkbox3,0,1)

                              Comment

                              Working...