Help with a Continous Form

R

Robert Gillard

I am trying to construct a simple program to help my daughter to revise for
a Latin exam.

There are just 5 fields in a single table (plus a query all with identical
fields on which a Continuous Form is based.)

AutoRefNum (to be field 5 on the form)
LatinWord (to be field 1 on the form)
Translation (to be field 4 on the form)
Answer (to be field 2 on the form)
RightWrong (to be field 3 on the form)


What I would like to happen is, using a Continuous Form that will have four
fields going across the page.

The first field would be the Latin word, the 2nd field would be Answer into
which my daughter would type her definition of the word in the first field.

If her answer is right, then the word "correct" appears in the 3rd field and
the translation appears in the 4th field. (sometimes a word will have
several meaning - so I want her to see the other possible Translations.)

I have discussed this on the "gettingstarted" group, The issue appears to be
the use of a Continuous Form and how to get the "Translation" to appear in
just the line in which the Answer has been typed. At the moment when an
Answer is correct the translations appear in the whole column. So if she
gets question 1 correct she sees all of the answers all the way down the
form.(I have the font colour set to white and it changes to black if the
answer is correct)

This is the code I am using "on entry" to "Rightwrong" from field 2 (my
daughters answer.)

If Me.Translate Like "*" & Me.Answer & "*" Then
Me.Rightwrong = "correct"
Me.Translate.ForeColor = 0
Else

Me.Rightwrong = "wrong"
Me.Translate.ForeColor = 16777215
Me.Answer.SetFocus
End If

Any solutions to solve this gratefully accepted, as well as any other /
better ways to create such a form.( I thought this was going to be a simple
5min job when I started 4 days ago. Just for information there will be about
3000 words in all, I had hoped to have approx 100 words randomly selected
each
time my daughter wanted to test herself. But I think I will leave that for a
latter time.)

Bob
 
M

Marshall Barton

Robert said:
I am trying to construct a simple program to help my daughter to revise for
a Latin exam.

There are just 5 fields in a single table (plus a query all with identical
fields on which a Continuous Form is based.)

AutoRefNum (to be field 5 on the form)
LatinWord (to be field 1 on the form)
Translation (to be field 4 on the form)
Answer (to be field 2 on the form)
RightWrong (to be field 3 on the form)


What I would like to happen is, using a Continuous Form that will have four
fields going across the page.

The first field would be the Latin word, the 2nd field would be Answer into
which my daughter would type her definition of the word in the first field.

If her answer is right, then the word "correct" appears in the 3rd field and
the translation appears in the 4th field. (sometimes a word will have
several meaning - so I want her to see the other possible Translations.)

I have discussed this on the "gettingstarted" group, The issue appears to be
the use of a Continuous Form and how to get the "Translation" to appear in
just the line in which the Answer has been typed. At the moment when an
Answer is correct the translations appear in the whole column. So if she
gets question 1 correct she sees all of the answers all the way down the
form.(I have the font colour set to white and it changes to black if the
answer is correct)

This is the code I am using "on entry" to "Rightwrong" from field 2 (my
daughters answer.)

If Me.Translate Like "*" & Me.Answer & "*" Then
Me.Rightwrong = "correct"
Me.Translate.ForeColor = 0
Else

Me.Rightwrong = "wrong"
Me.Translate.ForeColor = 16777215
Me.Answer.SetFocus
End If

Any solutions to solve this gratefully accepted, as well as any other /
better ways to create such a form.( I thought this was going to be a simple
5min job when I started 4 days ago. Just for information there will be about
3000 words in all, I had hoped to have approx 100 words randomly selected
each
time my daughter wanted to test herself. But I think I will leave that for a
latter time.)


Nice exercise, Bob.

The issue you're stuggling with is that you can not use code
to do anything to the controls on a continuous form.
Everything must be done using control source expressions
(for non-editable fields), Conditional Formatting (A2K or
later), or maybe a few other esoteric tricks.

Since the user should not be able to change the Answer
field, you can use an expression to either display it or
not.
=IIf(Nz(Translate,"") <> "" And Answer Like "*" &
Translate & "*", Answer, "")

Or use the condition part of the IIf above as the Expression
Is in Conditional Formatting to set the color to black.

I don't see a way to set the value of the RightWrong field
in the table. Actually, since the RightWrong value is
calculated from the Translate and Answer fields, it should
not be in the table anyway. However, you can use something
similar to the above to get the text box to display what you
want:

=IIf(Nz(Translate,"") <> "", IIf(Answer Like "*" &
Translate & "*", "Correct", "Wrong"), "")

On to the issue of selecting 100 words at random, set the
form's record source to a query like:

SELECT TOP 100 LatinWord, Translation, Answer
FROM thetable
WHERE Translate Is Null
ORDER BY Rnd(AutoRefNum)
 

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