By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,713 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,713 IT Pros & Developers. It's quick & easy.

check boxes

lee123
100+
P: 556
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.
Jun 9 '07 #1
Share this Question
Share on Google+
16 Replies

maxamis4
Expert 100+
P: 295
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.
Jun 9 '07 #2

MSeda
Expert 100+
P: 159
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.
Jun 9 '07 #3

lee123
100+
P: 556
is there a code that goes behind the option box or the check boxes?
Jun 9 '07 #4

lee123
100+
P: 556
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
Jun 10 '07 #5

NeoPa
Expert Mod 15k+
P: 31,770
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.
Jun 11 '07 #6

lee123
100+
P: 556
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 - CheckAnswerButton

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 "Incorrectbox"

Thanks
Lee123
Jun 12 '07 #7

NeoPa
Expert Mod 15k+
P: 31,770
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.
Jun 12 '07 #8

lee123
100+
P: 556
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
Jun 12 '07 #9

lee123
100+
P: 556
oh by the way the check boxes are single ones>
Jun 12 '07 #10

NeoPa
Expert Mod 15k+
P: 31,770
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 :
Expand|Select|Wrap|Line Numbers
  1. =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 :(
Jun 12 '07 #11

lee123
100+
P: 556
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
Jun 12 '07 #12

NeoPa
Expert Mod 15k+
P: 31,770
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 :)
Jun 12 '07 #13

lee123
100+
P: 556
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
Jun 13 '07 #14

NeoPa
Expert Mod 15k+
P: 31,770
In the Control Source of your two TextBoxes put :
  1. Correct
    Expand|Select|Wrap|Line Numbers
    1. =IIf(CheckA,1,0)+IIf(CB2,1,0)+IIf(Checkbox3,1,0)
  2. Incorrect
    Expand|Select|Wrap|Line Numbers
    1. =IIf(CheckA,0,1)+IIf(CB2,0,1)+IIf(Checkbox3,0,1)
Jun 13 '07 #15

lee123
100+
P: 556
thanks that worked ..you know i tried that but i don't know what happend maybe i put it in wrong but this time it worked thanks again for all your help...

lee123
Jun 13 '07 #16

NeoPa
Expert Mod 15k+
P: 31,770
Tell me about it Lee.
I've spent most of this week and last trying things that fail, only to find later on (when I've tried everything else and returned for a rerun out of simple desperation), that they are now working perfectly.
It tends to hold the project up just a little :(
Anyway, I'm glad that worked for you and good luck :)
Jun 13 '07 #17

Post your reply

Sign in to post your reply or Sign up for a free account.