Comparisson

D

DeeCee

I would like to compare 2 Files in Access Database 2000. One File is
questions and aswers correct and the other file is a selection of choose the
correct answer. I have inserted checkbox's in both files and they are both
the same except the checkbox in the one I am playing with is not ticked, but
my form is ticked to compare with the correct file sheet. Then I need to un
tick the check boxes and check to see if I can correct my errors by choosing
the untick form and play again. Can someone help.
 
J

jahoobob via AccessMonster.com

I have a questionaire (programmed instructions) with the question, answer1,
answer2, answer3, answer4, and correctanswer (1-4).
The form presents the question and the four choices with an option group of
four checkboxes beside each answer. If the answer is incorrect, a message
pops up stating so, I reset the option group to 0 and restate the question.
If the answer is correct, a message pops up stating so, I reset the option
group to 0 and go to the next question. The key is that resetting the option
group to 0 clears the answer. Here is the code I use:

Public Sub Answer_Click()
'On Error GoTo Err_Answer_Click
Cont = Me.Text35 'Get the number of questions answered
If Cont < 1 Then
Forms.frmSignIn.Blob = Me.Text34 'If this is the first correct answer,
set the total answers in the main form to the total questions in the query
End If

Select Case Me.Answer 'Check the answer
Case Is = Me.CorrAns 'If it is equal to the correct answer
DoCmd.OpenForm "frmCorrectAnswer", , , , , acDialog
Me.Answer = 0 'Reset the answer to make it ready for the next
answer
Cont = Cont + 1 'add 1 to the questions answered
Me.Text35 = Cont 'place the number of answers on the General subform
If Cont = Me.Text34 Then 'if the questions answered is equal to the total
questions in the query, close the form
DoCmd.Close acForm, "frmSignIn"
DoCmd.Close acForm, "General"
Exit Sub
End If
Forms.frmSignIn.Text21 = Cont 'set the questions answered in frmSignIn
to the number answered in nsubform General
Recordset.MoveNext
Case Else 'If the answer is not equal to the correct answer
DoCmd.OpenForm "frmIncorrectAnswer", , , , , acDialog
Me.Answer = 0
End Select

End Sub

As you can see, I accumulate the total questions answered, but you could do
questions answered correctly.
I store this number with the person who completed the questionaire for
records.

Hope this helps,
Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top