Micak wrote:
I'm using radnom selection in ms access to select certain number of
questions for the exam. i have two versions of the report:
- one without marked answers
- one with marked answers
the problem is when i generate the reports one after another, i don't
get the same selection of questions. Does anyone knows how to generate
two parallel reports that would give the same random selection?
Two ideas. One, create a table. Clear it out prior to running the
first report. Then run a procedure to create a random set of numbers
and insert the key into the table. Then ih your report add the new
table link the key to the field in the new table.
Create a variable. Run the proc and store all the keys into the
variable. Then do something like
Docmd.OpenReport "RptNmNoAnswer",,,"ID in (" & variable & ")"
Docmd.OpenReport "RptNmWithAnswer",,,"ID in (" & variable & ")"
and filter on that string of id's.
One other option. When you do the first Rnd, get the initial seed
value. If you use the same seed value, you should get the same random
sequence on the second set. Check out Rnd for more information.