Random Sort

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to randomly sort a table of Names [text fields]. I expect that
it is a simple task however I don't know where to begin. I am hoping someone
can point me in the right direction.
 
Look at the Rnd function in the help file.

Create a query based on your table. Add a calculated field named
"RandomNumber". Use the Rnd function to calculate a random number for each
record. Sort on the RandomNumber field.
 
If you create a little function like this:

Public Function RandomQ(S As String) As Single
RandomQ = Rnd
End Function

And use it in a query to generate a random number; then be sure to pass a
value (for example any description field of your record) otherwise the query
optimiser will evaluate the RandomQ function only once; hence no random
number per record!


PC Datasheet said:
Look at the Rnd function in the help file.

Create a query based on your table. Add a calculated field named
"RandomNumber". Use the Rnd function to calculate a random number for each
record. Sort on the RandomNumber field.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


message
I would like to randomly sort a table of Names [text fields]. I expect that
it is a simple task however I don't know where to begin. I am hoping someone
can point me in the right direction.
 
Back
Top