G
Guest
I am reposting this question.
I think it should be easy but I'm stuck...!
i have created a quiz form for users to test their knowledge of different
features in an Access database. Each question has 4 parts:
a) label for question e.g. lblQ1
b) unbound text box fo user to enter answer e.g. txtQ1
c) list box with correct answer (txtA1) based on SQL query
e.g. SELECT Max(PupilData.DeMerits) AS MaxOfDeMerits FROM PupilData;
d) text box (txtR1) which shows Correct or Wrong by comparing txtQ1 & txtA1
=IIf([txtQ1]=[txtA1],"Correct","Wrong")
I thought this should work without problems.
Control txtA1 should always be hidden.
Control txtR1 appears when txtQ1 is updated.
Code used is:
Private Sub txtQ1_AfterUpdate()
Me.txtR1.Visible = True
Me.txtA1.Requery
End Sub
The problem is that txtR1 shows "Wrong" even when txtQ1 & txtA1 are
identical until I click the control txtA1 when it updates correctly.
This means I cannot hide the answer txtA1 as planned!
However, once i have clicked in txtA1 once, the response txtR1 then updates
correctly if new answers are entered in txtQ1.
I have tried requerying txtA1 as the form loads but this doesn't have any
effect
How can I add code so that the control is automatically clicked ...or change
the code to have the desired result?
I'm sure there is a very obvious solution to this but I'm stuck at present
Any ideas?
I think it should be easy but I'm stuck...!
i have created a quiz form for users to test their knowledge of different
features in an Access database. Each question has 4 parts:
a) label for question e.g. lblQ1
b) unbound text box fo user to enter answer e.g. txtQ1
c) list box with correct answer (txtA1) based on SQL query
e.g. SELECT Max(PupilData.DeMerits) AS MaxOfDeMerits FROM PupilData;
d) text box (txtR1) which shows Correct or Wrong by comparing txtQ1 & txtA1
=IIf([txtQ1]=[txtA1],"Correct","Wrong")
I thought this should work without problems.
Control txtA1 should always be hidden.
Control txtR1 appears when txtQ1 is updated.
Code used is:
Private Sub txtQ1_AfterUpdate()
Me.txtR1.Visible = True
Me.txtA1.Requery
End Sub
The problem is that txtR1 shows "Wrong" even when txtQ1 & txtA1 are
identical until I click the control txtA1 when it updates correctly.
This means I cannot hide the answer txtA1 as planned!
However, once i have clicked in txtA1 once, the response txtR1 then updates
correctly if new answers are entered in txtQ1.
I have tried requerying txtA1 as the form loads but this doesn't have any
effect
How can I add code so that the control is automatically clicked ...or change
the code to have the desired result?
I'm sure there is a very obvious solution to this but I'm stuck at present
Any ideas?