top clients

J

JohnE

The report is one to display the top 'n' clients. I have
a form (FormA) that has on it an unbound textbox
(txtTopClients) for the user to put a number in and the
report will show the clients. I designed a query to show
the top 10 based on the knowledge base article. But, I
would like to have the user place a number in the txt box
and the report show accordingly. I am stumped at how to
get it to work.
Any thoughts are accepted.
*** John
 
M

Marshall Barton

JohnE said:
The report is one to display the top 'n' clients. I have
a form (FormA) that has on it an unbound textbox
(txtTopClients) for the user to put a number in and the
report will show the clients. I designed a query to show
the top 10 based on the knowledge base article. But, I
would like to have the user place a number in the txt box
and the report show accordingly.


You'll have to set the report's RecordSource property in its
own Open event. Get rid of the TOP 10 in your existing
query and then use code along these lines:

Me.RecordSource = "SELECT TOP " & _
Forms!theform.thetextbox & _
" * FROM yourexistingquery"

Make sure that the form remains open (can be invisible)
while the report is running.
 

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