limiting query results to a number based on user input

D

Dan S.

Hi, I have a tricky one for you. I have a form in my
database that returns records from queries based on the
form. What I'm wondering is if it is possible to limit the
number of results returned based on a number the user
enters on the form. For example, say I have 100 accounts
that meet a certain set of criteria, but the user only
wants the query to return 15 random results from the 100
matching accounts. Is there a way to have the user enter
the number of accounts they'd like returned on the form,
then have the query limit the number of results returned
based on that inputted number?

Hope this makes sense; feel free to email me at

dsprouse##no Spam## at rcap dot com (remove ##no Spam##)

if you need further clarification.


Thanks a bunch for your help.



-Dan.
 
J

John Spencer (MVP)

The only way I know to do this is to build the query on the fly use a TOP n
clause. Do you have enough VBA experience to do so?
 

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