Random test

  • Thread starter Thread starter Paul \(OMAC HX\)
  • Start date Start date
P

Paul \(OMAC HX\)

Hi ,

I am wondering is it possible to set up a database where i can keep adding
questions to a table and then print out a random test from the questions
entered. like 30 random questions out of the database and thenprint them.

Also ifthis can be done what way would it have to be laid out soicould
alsogive the wuestion and 4 multiply choice answers with it also.

Thanks for any helpwith this

PAul
 
Add this function to a standard module:

Function Randomizer () As Integer
Static intPicked As Integer
If intPicked = False Then Randomize : intPicked = True
Randomizer = 0
End Function

Then use the ID column which is numeric and unique. So 30 questions picked
at random would be:

Select Top 30 * From tblMyData
Where Randomizer() = 0
Order By Rnd(isnull(tblMyData.ID) * 0 + 1)
 
Back
Top