-----Original Message-----
Firstly random selection is achieved by passing your auto-number field into
the Rnd() function. Access does nothing with the numeric field, but if you
don't pass something in the query optimizer doesn't bother calling the
function for every row.
Queries have a Top Values property where you can ask for a specific number
of records:
SELECT TOP 10 * FROM MyTable ORDER BY Rnd ([QuestionID]);
However, you need to run the query once for each category to get 10
questions per category.
A simple solution is to create a report that lists the categories, with a
subreport to list the questions in each category. Access matches the query
to the category, and pulls out a random selection of records until it has 10
from each category.
Don't forget to execute a Randomize.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
I have a table with two fields (questions and
catagories). The catagories is a drop down list with four
choices. Is it possible to query 10 random questions from
each catagorie?
Thanks
Rick
.