Hi, I hope someone can help. I'm trying to create a scoring programme for a multiple choice test. Basically my form has 2 different sets of variables - one for the answer the testee provides (named q1 - q6; possible data a, b, c or d) and one for the score (named s1 - s6; scored 1 for correct and 0 for incorrect).
The "answer" variables I have set up as one collection (aItems), and the "score" variables as another (aScores). At this stage I am treating all answers (q1 - q6) as though "a" is the correct answer.
Access does not seem to have a problem with the first collection/loop, but doesn't seem to recognise the second collection/loop, no matter what I do????
Sub aItems()
Dim aItems As New Collection
Dim intCounter As Integer
Dim ctlA As Variant
aItems.Add q1
aItems.Add q2
aItems.Add q3
aItems.Add q4
aItems.Add q5
aItems.Add q6
Dim aScores As New Collection
Dim intCounter2 As Integer
Dim ctl1 As Variant
aScores.Add s1
aScores.Add s2
aScores.Add s3
aScores.Add s4
aScores.Add s5
aScores.Add s6
For Each ctlA In aItems
' For Each ctl1 In aScores
If ctlA.Value = "a" Then
ctl1.Value = "1"
Else: ctl1.Value = "0"
End If
' Next ctl1
Next ctlA
End Sub