The information in this article applies to:
SUMMARYNovice: Requires knowledge of the user interface on single-user computers.
MORE INFORMATION
To shuffle the records in a table, create a query based on that table and
all its necessary fields. Add a calculated field that contains the Rnd() function with a positive integer variable parameter. Then, sort by this calculated field. Every time that you evaluate the query, the records will be shuffled.
the query calculates the Rnd() function once and then repeats the same value throughout the recordset. To avoid the repetition, create a
calculated field with a variable numeric argument. For example, if the
table has an Employee ID field, you can use the following expression as the
variable numeric argument:
If the table does not have a numeric field, write an expression such as the
following to calculate a numeric value based on any other field:
The Rnd() function ignores the expression, but the variable nature of the argument forces the query to evaluate the Rnd() function for every record.
REFERENCESFor more information about the TopValues property, click Microsoft Access Help on the
Help menu, type "TopValues" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic. Q210468 ACC2000: Sample Function to Return a Random Record from a Field Additional query words:
Keywords : kbusage kbdta QryGnrl |
Last Reviewed: May 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |