returning only a selected number of records

  • Thread starter Thread starter Anthony
  • Start date Start date
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
 
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 ....
 
Back
Top