random function

It seems VBA can ensure random selection.

I have attached a sample database. You can open the form, specify the number of random records to return, and click on the command button to run the query.

The code used is in the On Click event of the command button. It updates a temporary table "tblTemp" with random ID_LAPISs and runs the query, which joins the data table with the temporary table.

The code was written in DAO. To write the code in Access 2000, a reference must be made to DAO (when the code window is open, choose menu Tools, References ... and select the Microsoft DAO 3.6 Object Library.)
.
 

Attachments

Users who are viewing this thread

Back
Top Bottom