Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specify Top Values Query Property in the Form 1

Status
Not open for further replies.

demzre

Technical User
Aug 18, 2003
7
US
I'm quite a novice at Access, but have learned a lot from all of you. I have a question that hopefully one of you can help me with.

I trying to create a way to select a random set of records. So far I have created a query that assigns random numbers to each query result using the RND(). By adjusting the Top Values property, I can decide the number of random results. However, I do not want to prespecify the the Top Values property. Instead, I would like to create a form where a user can enter a number in a text box and that number will be the number of Top Values. I've been looking through the forum for this answer, but couldn't find it. Any ideas, suggestions, and tips will be greatly appreciated.

Thanks!
 
On line help specifies that you cannot modify topvalues property through vba code.

But you can use a tmp table filling via VBA with the top n records of the query result (the form could show the tmp table contents).

 
Thanks for your help. It's too bad VBS doesn't allow you to do that because it would solve so many issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top