473,388 Members | 1,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

check boxes

lee123
556 512MB
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
16 2197
maxamis4
295 Expert 100+
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
159 Expert 100+
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
556 512MB
is there a code that goes behind the option box or the check boxes?
Jun 9 '07 #4
lee123
556 512MB
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
32,556 Expert Mod 16PB
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
556 512MB
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
32,556 Expert Mod 16PB
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
556 512MB
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
556 512MB
oh by the way the check boxes are single ones>
Jun 12 '07 #10
NeoPa
32,556 Expert Mod 16PB
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
556 512MB
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
32,556 Expert Mod 16PB
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
556 512MB
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
32,556 Expert Mod 16PB
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
556 512MB
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
32,556 Expert Mod 16PB
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

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

Similar topics

4
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers...
2
by: Edward | last post by:
The following html / javascript code produces a simple form with check boxes. There is also a checkbox that 'checks all' form checkboxes hotmail style: <html> <head> <title></title> </head>...
2
by: Ben | last post by:
My current project requires me to create part of a form that is created on the fly. The project consists a list of entries to an event. The name and address and such is easy. The design is detup so...
0
by: Robert | last post by:
Stephen, I think I figured out the problem. I was able to get Check Boxes and Option Buttons to work on my form by TURNING OFF RECORD SELECTORS on the form. Not sure why this would make a...
11
by: Darryl Kerkeslager | last post by:
I wanted to test for only one True value in a bunch of checkboxes, so I figured I could just test for a value of exactly -1 after adding the values. In case 0 below, it worked. But in all other...
2
by: muthu | last post by:
Hi freinds, In my aspx page i have generated some check boxes dynamically using dhtml. When i check any check box and submit the form,how can i capture the value of check box. How should i...
2
by: cpptutor2000 | last post by:
Could some PHP guru please help me? I have very standard PHP - MySQL application that reads in some data from a table and for each row, puts a check box at the start of the row. Now the check boxes...
1
by: Java Kumar | last post by:
Hi Friends, I have a form which contains elements such as check boxes,text box,text area ., Problem is in Check boxes. By default, Check boxes are unchecked and text boxes...
4
by: wish | last post by:
Dear all; I have a lot of check boxes in the page..if the the user keep check the check boxes rather then check one check box for all check boxes will checked.. May i have ur help to refer?...
2
by: KMEscherich | last post by:
Microsoft Access 2003 Hi there, am stuck with something that I am not sure on how to get done. I am attempting to have 3 check boxes and have 3 date fields. I need to have each date field be...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.