Choosing Records for a Report

J

Joe

Hello All

I am writing a database that requires me to generate reports based on user input. Specifically, I need to allow the user to enter the number of records from each category that she prefers. I then need to generate a report that selects that number of questions randomly from the table (all records are in the same table)

For example, if the user decides that he would like 50 records that are categorized as 'Renal' [RenalSubMix] and 50 records that are categorized as 'GI' [GISubMix], then I must generate a report that pulls 50 random records from each category and displays them in the report, "Student Exam.

I know how to find the total numbers of each record
RenalCount = DCount("[Subject]", "tblExam", "[Subject] = 'Renal'"
GICount = DCount("[Subject]", "tblExam", "[Subject] = 'Gastroenterology'"

So I will need to randomly select 50 records out of RenalCount and 50 out of GICount and display them in "Student Exam." I know this may be a tough one (it certainly is for me!), so I really do appreciate anyone's assistance. Thanks for the help!
 
Top