>Hi
>
[quoted text clipped - 10 lines]
>
>Any help/thoughts?
Access "saves time": when it realizes that Rnd() is called for every record,
it calls it once only and uses the same result for all the examples.
You need to pass the value of a field as an argument. There are two ways to do
this: if you have a number field that you know for certain will never be zero
or less, and will never be null, use Rnd([fieldname]). Or you can use
this little function into a Module:
Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function
Then add a calculated field to your Query by typing
Shuffle: RndNum([fieldname])
John W. Vinson [MVP]
Craig - 29 Nov 2007 04:53 GMT
Thanks John
I used the autonumber ID field in my table as the fieldname in your first
suggestion. It works perfectly.
c
> On Tue, 27 Nov 2007 22:35:19 -0600, "Craig"
> <msaccess@howardhowardfine.com>
[quoted text clipped - 42 lines]
>
> John W. Vinson [MVP]