Link to home
Start Free TrialLog in
Avatar of Allen Pitts
Allen PittsFlag for United States of America

asked on

Access form for test

Good afternoon expert,

Created an exam simulator using Javascript to study for an exam called ITIL (Info Technology Infrastucture Library)
It works well but it would work better if
1. The questionsa were in different order every time I opened the Exam form.
2. The answers to the questions were in different order every time I opened the Exam Form

That is, Question 2 would be question 5 the next time I open it. And answer one to question 5 would be answer three to question 5 the next time the test is opned.

Finally the form attached displays the four possible answers. How could I put a button or user controlled event handler that would display the correct answer?

I know this is a lot of questions but if you could just give me the concept I think I can fidgure it out.
Or if you want me to I could rework it into a series of questions.

Thanks.

Allen in Dallas
ITIL-test.mdb
Avatar of Michael Vasilevsky
Michael Vasilevsky
Flag of United States of America image

You'll need to use and unbound form instead of a bound form and populate the controls randomly...
the file uploaded is to show the answer.. as far as the other question see mvasilevsky comment
Example attached. Try opening the frm_Test a few times and look at the On Open event VBA code
HTH,

MV
ITIL-test.zip
Avatar of Allen Pitts

ASKER

Hello mvasilevsky:
Well maybe I over estimated ny abilities in saying that I could figure it out.
I read about unbound controls is that the same an unbound form?
If so then how does one get the recordset into the form if it is not bound
to the data
'Unbound control  A control that doesn't have a source of data (such as a field or expression) is called an unbound control. You use unbound controls to display information, lines, rectangles, and pictures. For example, a label that displays the title of a form is an unbound control.'

Thanks.

Allen in Dallas
Hello mvasilevsky:

I thnik I see where you are going. Although there are two forms in the MDB sent one
is the form I did and the other when clicked oin returns
Run-time error '-2147217838 (80040e52)
Data source object is already initilaized'
But I could open the VBA. It looks like to variables are created.
One, rst,  is the recordset and the other (x) is an interger used to maniplulate
the order of the questions. It looks like x is set to be the rescordset minus
one and plus one. Can't see why you would add one to the interger and
then subtract it.  Then the variable is muliplied times a random number
and incremented. What does that do?
What dos the xpression rst.Move x -1, 1 Do?
What is Me!
Thanks.
Allen in Dallas


ASKER CERTIFIED SOLUTION
Avatar of Michael Vasilevsky
Michael Vasilevsky
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial