Access database quiz

R

ridders

This should be an easy question!

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'm sure there is a very onvious solution to this but I'm stuck at present
Any ideas?
 

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