I have a form I have been working on and now I am almost done with it but there is just one thing I need to finish it that I can figure out. Well I have a questionnaire form with 50 questions and I want to have a msgbox display at the end of the questionnaire "failed" or "passed" when the users have finished the test. On this form I have text boxes with "correct' and "incorrect" and a text box for the total percentage of the correct. This is what I got in codes:
FOR THE "CORRECT" TEXTBOX THE CODE I HAVE PUT IN THE CONTROL SOURCE IS THIS, -
-
=IIf([CHECK4],1,0)+IIf([CHECK16],1,0)+IIf([check22],1,0)
-
+IIf([CHECK46],1,0)+IIf([CHECK33],1,0)+IIf([CHECK58],1,0)
-
+IIf([check73],1,0)+IIf([check103],1,0)+IIf([CHECK112],1,0)
-
+IIf([CHECK150],1,0)+IIf([CHECK153],1,0)
-
FOR THE "INCORRECT" I HAVE PRETTY MUCH THE SAME: -
=IIf([CHECK6],1,0)+IIf([CHECK8],1,0)+IIf([CHECK14],1,0)
-
+IIf([check12],1,0)+IIf([check20],1,0)+IIf([check28],1,0)
-
+IIf([CHECK30],1,0)+IIf([CHECK37],1,0)+IIf([CHECK39],1,0)
-
+IIf([CHECK41],1,0)+IIf([CHECK43],1,0)+IIf([CHECK56],1,0)
-
+IIf([check65],1,0)+IIf([check67],1,0)+IIf([check71],1,0)
-
+IIf([check105],1,0)+IIf([check108],1,0)+IIf([check101],1,0)
-
+IIf([CHECK119],1,0)+IIf([CHECK148],1,0)
-
FOR THE PERCENTAGE TEXTBOX THIS IS WHAT I HAVE:
=[CORRECT]/50
THIS IS JUST A LITTLE BIT OF THE CODES I HAVE NOT INCLUDING THE CHECKBOXES FOR THE ANSWERS WELL IF IT HELPS THIS IS ONE OF THE CHECKBOX CODE FOR THE INCORRECT: -
If Check12 = Check12 Then
-
Check12.Enabled = True
-
Check14.Enabled = False
-
Check16.Enabled = False
-
Check12.Locked = True
-
MsgBox "INCORRECT! THE CORRECT ANSWER IS 40 HRS"
-
End If
Well this is just about what I have, but my question is how can I put a msgbox at the end of all of this that replies "failed" or "passed" or if the user gets so many questions wrong the message box would pop up with "failed"
This is probably too much right ?
LEE123
13 2338 tdw 206
New Member
I don't know if it's just my browser or what, but your post is very difficult to read.
could you please try reposting it without all the caps, and use the CODE tags around the code, as is explained in the little yellow box to the right of the typing window? Thanks
ok i have a form i have been working on and now im almost done with it i have made a driving written test with 50 questions on it and the only thing i need is some kind of msgbox or a lable that pops up when the user gets done with the test. that displays either "failed" or "pass". i want to know if i can base this message on the incorrect textbox so if the user gets so many wrong the words "failed" would pop up. otherwise it would say "passed" the codes i have for the two textboxes is:
for the correct textbox i have this: - =iif(checkboxname,1,0)+iif(checkboxname,1,0)
there is alot of them.
the incorrect textbox i have: - =iif(checkboxname,1,0)+iif(checkboxname,1,0)
for the checkboxes the code behind it is: - If ANSWER2 = ANSWER2 Then
-
ANSWER2.Enabled = True
-
ANSWER1.Enabled = False
-
ANSWER3.Enabled = False
-
ANSWER2.Locked = True
-
msgbox ("CORRECT!")
i don't know if i did this right but all of it works i just need to know how i can get the "failed" to pop up either in a msgbox or lbl if they get to many wrong.
can you help me.
ps i never knew how to make the tags work but now i know thanks.
lee123
tdw 206
New Member
ok i have a form i have been working on and now im almost done with it i have made a driving written test with 50 questions on it and the only thing i need is some kind of msgbox or a lable that pops up when the user gets done with the test. that displays either "failed" or "pass". i want to know if i can base this message on the incorrect textbox so if the user gets so many wrong the words "failed" would pop up. otherwise it would say "passed" the codes i have for the two textboxes is:
for the correct textbox i have this: - =iif(checkboxname,1,0)+iif(checkboxname,1,0)
there is alot of them.
the incorrect textbox i have: - =iif(checkboxname,1,0)+iif(checkboxname,1,0)
for the checkboxes the code behind it is: - If ANSWER2 = ANSWER2 Then
-
ANSWER2.Enabled = True
-
ANSWER1.Enabled = False
-
ANSWER3.Enabled = False
-
ANSWER2.Locked = True
-
msgbox ("CORRECT!")
i don't know if i did this right but all of it works i just need to know how i can get the "failed" to pop up either in a msgbox or lbl if they get to many wrong.
can you help me.
ps i never knew how to make the tags work but now i know thanks.
lee123
Does your test form pop up a single question at a time? If so, once the next question comes up, is there anything remembering what they had answered on the last or previous questions, i.e. a new record in a table or something?
to answer your question no the questions are on the form i used a label for the questions and however many check boxes i needed for the answers sorta like this:
(question):
how many hrs does a person under 17 have to complete before driving:
(answers) - checkbox 1
-
checkbox 2
-
checkbox 3
-
checkbox 4
there all in a colunm going from top to bottom does that make any sense or
should i' ve done something different?
i guess to understand your question it would be like this: if you had a piece of paper and numbered question 1 question 2 and question 3 down the paper thats what it would look like and had the answers under the questions like a,b.or c
multiple choice.
lee123
if the user picks a wrong answer the other answers are disabled so they can't change there mind but if the user picks the right answer the others disappear leaving only the right answer.
tdw 206
New Member
if the user picks a wrong answer the other answers are disabled so they can't change there mind but if the user picks the right answer the others disappear leaving only the right answer.
So all of the questions are on the form at the same time, like a full sheet of test questions? And once the student clicks on an answer, whether right or wrong, they cannot change their answer?
I'm learning Access as I go here, and I'm no expert yet. Since I have received so much help on this forum I like to try to help where I can. I have an idea though, see what you think (and what others on the forum think):
Maybe if you have a variable that counts up +1 every time a question is answered wrong, then every time it adds one to the variable it checks to see if it has reached the max limit of allowable wrong answers... then when it reaches it, it displays the FAILED LOSER!! (or something) message box and ends the test. If you're not sure how to do this and no one else has a better way, please let me know.
NeoPa 32,556
Recognized Expert Moderator MVP
Lee,
Your code for correct is ok, but your code for incorrect should be of the form : - =IIf(FirstCorrectCheckBox, 0, 1)+IIf(SecondCorrectCheckBox, 0, 1)+...
not - =IIf(FirstWrongCheckBox, 1, 0)+IIf(SecondWrongCheckBox, 1, 0)+...
NB The order of the 1s & the 0s.
yea i'm not that good at variables i mean everytime i try it never works i see how it looks in my head but when i attempt it, it never works variables to me are tricky i've tried to do one and i don't get how they work so i don't know how to do this, i've tried the if ....then statement but nothing i wanted to try to use the iif with the incorrect code but nothing.
lee123
yea i'm not that good at variables i mean everytime i try it never works i see how it looks in my head but when i attempt it, it never works variables to me are tricky i've tried to do one and i don't get how they work so i don't know how to do this, i've tried the if ....then statement but nothing i wanted to try to use the iif with the incorrect code but nothing.
lee123
try something simple
dim counter as long
counter = 0
then after each question,
if answer = correct then counter = counter +1
and so on?
yea i'm not that good at variables i mean everytime i try it never works i see how it looks in my head but when i attempt it, it never works variables to me are tricky i've tried to do one and i don't get how they work so i don't know how to do this, i've tried the if ....then statement but nothing i wanted to try to use the iif with the incorrect code but nothing.
lee123
try something simple - dim counter as long
-
-
counter = 0
then after each question, - if answer = incorrect then counter = counter +1
-
if counter = maxfail then
-
msgbox("Better luck next time")
-
exit
and so on?
Appoligies for the multi post, I accidently tabbed on the submit button, didn't realise you can't tab in this box!! sorry
NeoPa 32,556
Recognized Expert Moderator MVP
Apologies for the multi post, I accidently tabbed on the submit button, didn't realise you can't tab in this box!! sorry
No problem & thanks for explaining. I whipped out the second copy so it reads better now.
With reference to your solution, remember that the operator is not constrained in any way to answer the questions in order, nor, without some extra coding, to answer them only the once.
thanks you guys for all your help i'll try what you said and hopfully it works if not i'll write back thanks,
lee123
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: New MSSQL DBA |
last post by:
hi all, have anyone else met with the following problem.
we've got a SQL2000SP3a on a 2 active-active node clusters of W2K3,
this cluster in using AD.
I've found that whenever I use Enterprise...
|
by: Ravi J |
last post by:
I am trying to load Microsoft Word and create a document in ASP.NET (C#). But the call to application creation 'Word._Application app = new Word.ApplicationClass();' takes quit a bit of time, and...
|
by: Jonas Auken |
last post by:
hi,
I have a repeater which dynamically loads another usercontrol throught
databinding:
OnClick: DataBind()
rptProduct_ItemDataBound: ViewSmall _viewSmall = (ViewSmall)...
|
by: Steve M |
last post by:
A few users today received the message "The trust relationship between this
workstation and the primary domain failed" on their web browser while using
an ASP.NET web app. The problem went away...
|
by: xieliwei |
last post by:
I have a freshly installed openSuSe 10.2 with PHP4 from
http://download.opensuse.org/repositories/home:/michal-m:/php4/openSUSE_10.2/
(openSuSe abandoned PHP4 since version 10, but I have customers...
| |
by: kilo |
last post by:
Hey.. I need someone hwo can help me making my sql table..
I have no php skills. I have payed for a php program that shoud make dictation for people that have some problems reading danish.. with...
|
by: haneeshkb |
last post by:
I am getting this problem when I tried to build my borland c++ project.
(compling and make doesn't giving any problem )
Fatal: Fatal: Assertion failed: !"How can you expand a vapor heap?" at...
|
by: sa6113 |
last post by:
I am using this code to connect to a windows machine using paramiko, I have
installed sshd on the machine and it works properly:
sock.connect((hostname, port))
t = paramiko.Transport(sock)...
|
by: CoreyReynolds |
last post by:
Hey all,
I have a piece of code that dumps a bunch of data into a spreadsheet. Also rearranges it into a pivot table and then graphs the pivot table as well so my boss can get a clear view of the...
|
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...
|
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,...
| |
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |