returning only a selected number of records

A

Anthony

I have a tabel of questions and answers with autonumber. I have
created a query that randomizes the autonumber so that the questions
always appear in a different order when I run the query. The only
problem is that I have about 1800 questions and I don't need all of
them on a quiz. I know you can manually determine how many record are
returned in a query by going to design mode and changing it. However I
want to use a form that I always run before the query to determine the
number of record returned. Like I have a textbox that I put X into and
then run the query and it returns only X number of records. I'm pretty
sure I have to do something with VB, but I don't know much about VB.
Can anyone help?
Thanks so much!!
Merry Christmas
Anthony
 
K

Klatuu

Use the TOP predicate in your query to return the number of records you want.
You could construct your query to look for the value in a text box on your
form:

SELECT TOP Forms!frmQuiz!txtQuestions ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top